I don't know if it is pertinent to this at all, but I raised https://bugs.python.org/issue44449 in which the faulthandler module can lead to a segfault inside Py_TRASHCAN_SAFE_BEGIN. Would that be avoided if frameobject.c was changed to use Py_TRASHCAN_BEGIN / END?