I wonder, could the SetExtState and GetExtState functions help? Or even SetProjExtState and GetProjExtState? Which allow persistent data across projects.
Otherwise, variables "are stored in a more compact 32 bit representation", according to this:
https://www.cockos.com/reaper/sdk/js/js.php
Maybe just write some data and check it in a text or hex viewer. You can't get more compact than binary. Unless it uses BCD for portability.