Wrapping legacy scripts for reproducibility I'm setting up a system that transforms data through several steps using code written by many people with many levels of coding experience. I'm aiming to achieve reproducibility of the whole process by fully defining the inputs and outputs of all the executing steps. 

The problem I'm having is that many of the script that need to run have side effects, which can break this determinism. I want to minimise the amount of rewriting of people's code that I have to do, since this system needs to remain usable by those people.

How can I effectively sandbox scripts so that their inputs and outputs are guaranteed to be well defined? My first thought was through containerisation using eg Docker, but our HPC cluster doesn't yet support this so I'd prefer lighter weight options. Feel free to assume python scripts, although the ideal answer would be language agnostic.
For HPC systems, wrapping scripts in a Singularity container https://sylabs.io/docs/ could be an option.