you could mitigate side-effects by running all of lighttable in a VM, assuming no files and creating all the ones you need. Network requests could be intercepted. The key to make this workable would be sensible defaults, allowing you to just open it up and start a new project instantly, and allowing custimization for complicated projects.
All you need is a VM, a good standard library with mostly functions with minimal side deffects, a way to save all runtime state, and a way to log every change and replay them in case of a crash.
In Smalltalk, this isn't a problem. Our Dictionary instances are mutable. Usually, we realize it while continuing the debugging/editing (they happen at the same time) and we either rewind the stack a little further to get a new instance of the dictionary, or we can easily undo the side effect. It usually happens in less than the amount of time you took to read the previous sentence.