Patch #1680961: remove sys.exitfunc and replace it with a private C API. Also, reimplement atexit in C so it can take advantage of this private API.
diff --git a/Python/import.c b/Python/import.c
index 33953c7..6d65703 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -361,7 +361,7 @@
 
 /* List of names to clear in sys */
 static char* sys_deletes[] = {
-	"path", "argv", "ps1", "ps2", "exitfunc",
+	"path", "argv", "ps1", "ps2",
 	"exc_type", "exc_value", "exc_traceback",
 	"last_type", "last_value", "last_traceback",
 	"path_hooks", "path_importer_cache", "meta_path",