Ok, this one will be tricky.
I got the reason of the error, the Python interpreter, and so Ren'Py... ran out of memory
This mean that the game use 4GB of memory and still needs more. And looking at the game I understand why, they save
everything, from the description of a quest, to a list of 2000 random numbers previously generated (what is totally useless). The problem being that, due to the rollback feature, Ren'Py keep generally between 30 and 50 copy of all the variables, while my tool need to also copy them in order to works.
It's to the point that a save file already weight 742 KB when you finally starts the game ; for reference most Ren'Py games will have save files below 1 MB (1.024 KB) if you save at the end of the game.
Big2019 can you look in "[path to the game]/Straitened Times/game/saves" what is the size of the files ? Don't try to attach one, I'm pretty sure that it's way too big, but it's for me to have a better idea of it.
All this imply that I'm not sure to be able to fix this issue, and most likely my tool will not be usable with this game ; at least not on a long run.
I'll still try to fix it, but so far I don't really know how. I can't reduce the memory used by the game, what represent around 70% of the said use. And blindly reducing the memory used by my tool would remove its interest (you wouldn't be able to know when a value changed).