So for minetest scripting, probably the most straightforward way to deal with it is to use mymod.myvar, rather than hassling with passing local variables as parameters?
I'm not seeking to do anything much different than any settingtypes.txt value. Rather than running a codeblock to determine which mods and settings are selected in each individual dofile, each time it's parsed, and keep them all updated, I'd just be moving that block to run once in the init.lua (or only once at load time) and set essentially an environment variable.