This is documented right above the section that I linked to earlier… Reference — openHAB Helper Libraries documentation
It would probably help if you would read through all of the helper library documentation.
You had said constants, which do not change and work great when stored in modules. If you want to share a variable across scripts, you could use a ScriptExtension…
You could also create a class with a getter and setter to store/return the data. None of these will persist the data between OH restarts though, so if you want it to be around after a restart, Item metadata may be the best place for it. Although, there are other ways to add things to persistent storage and this is functionality that I plan to add to the core libraries.