I sometimes put "globals" in a key/string container with accessor functions. I'm not sure if that's better or not.
The only project I have that does it (or will, since I haven't written that part yet) is a shell I'm writing; it will use the container to store shell variables.