Putting it in the top scope of your compilation unit is a simple hack, for the many basic cases where that happens to be the global scope.
That's not entirely global though. That's an object scope. Just because you're unlikely to create more instances of that object doesn't make it global. :)
Another way is to add_constant() it in a separate loader file which compiles and spawns your main code.
Which doesn't give a variable. You can create a sort of global scope with it though, add_constant("my_globals",([])) or so. But it needs to be done before you compile anything that wants to use it.
A third variant I just tried failed on a bus error in 7.6 and 7.7: global.hello = "world!";
Interesting.