the answers that have already been given are good for what you're asking about, but the actual answer is that there aren't global variables in gdscript. there is no global namespace, and there is no way to inject things defined in one namespace into another. yes, you can look up any node in a scene and access its member variables, but that's not a global variable, no matter if the node is implicitly added to the scene.
let's say you wanted to have a separate file full of game related constants and types. you can do that and (pre)load the file anywhere you want to use it.
var smeg = preload("res://utils/constants.gd")
that's basically a global, right? no, because this is how you refer to anything defined in constants.gd:
SOME_CONSTANT is not in the global namespace.
strictly speaking there is a global namespace, but users can't add to it.