TL;DR: Here's an implementation of setjmp() and longjmp() for Python 3.6+. The state of the program can be serialized to disk or over the network. There are a few other twists and Python flavors. If ...