-> void is optional. with gdscript but the template adds it when you create a new script. So I leave it alone.
Yes will work. As long as you keep the script on the Buttons. You can also customize the label text for each button E.g.
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var label: Label=Label.new()
label.name="Danger"
add_child(label)
match name:
"Button":
$Danger.text="%s\ndanger" % name
"Button2":
$Danger.text="%s\ndanger2" % name
"Button3":
$Danger.text="%s\ndanger3" % name
"Button4":
$Danger.text="%s\ndanger4" % name