http://intarweb.us:8080/evil/become.py
It has some problems: it uses hardcoded struct field offsets (I know how to fix this - gather empirical evidence about the proper offsets by twiddling carefully selected values and then examining raw memory - it’s just a question of writing out all the right tests); it doesn’t support all of Python’s types, just enough to make a good example (this is easy to fix, just another question of investing time); it only runs on libc6 systems; and it reads and writes memory directly and manually manages refcounts in some places, so bugs generally lead to segfaults :)
All that said, it works pretty nicely on the types it supports: lists, tuples, dicts (that includes class, instance, and locals), and cells. Not a bad chunk of evil for half an afternoon, I’d say.