A python script/module is never terminated , it always sleeps … unless… it’s waken up by one/many sensor(s) that pulse them (positively or negatively) . So yeah better not wake up a script/module each logic tic if that script has nothing to do particular at that time. The best thing to do is to associate a specific task accomplished by a module and identify strictly at which moments in has to be call - and for that choose the good sensor(s) . So basically the worst, is to execute a huge single script and pulse it with an always sensor set with the spamming option on so it executed all the time. Unfortunately a very common bad habit.
the global dictionary is usually used to store permanently all variables . In python , example
### init ##
dct = bge.logic.globalDict
dct['pos'] = Vector(plr.worldPosition)
dct['dlt'] = Vector([0.0,0.0,0.0])
dct['loc'] = [0.0,0.0,0.0]
dct['spd'] = 0
EDIT :
check that actuator brick … it does nothing else than read/write the global dict in a external default file " .bgeconf" you will find next to blender.exe . So you gonna have to - only once - create yourself a global dictionary with python like shown above and save it with that save brick (with that, your .bgeconf file will exists) . After that, in your final game, you gonna be able to import the saved dictionary with the load brick - update its values with python - and save the updated with the save brick
The stupid thing is that you can read/save also with python and you gonna need python to update values anyway . … so…
bge.logic.saveGlobalDict() # save globalDict externally
bge.logic.loadGlobalDict() # replace the current globalDict with the saved one
yes str() a numerical value will require to use python too . But do you really have to use strings ? Use integers and use them like index for any dictionary
On the other hand, a cool method I use, is to assign value to a property from a dictionary i created on the fly
player['status'] = {True: "no value found" , plr['hp'] >= 50: "feel ok" , plr['hp'] >= 20: "suffering", plr['hp'] >= -100 : "game over", }[True]
Player status “value” will be the last one which KEY will be evaluated as being equal to True (ofc, you can add more conditions beside plr[‘hp’] … somehow write a if, elif , … , elif , else statement in a single line (but priority is reverse : last value has the last word)