clearcache() needs to remove the dict as well as clear it.
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 41cdca7..6149964 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1887,8 +1887,7 @@
 static PyObject *
 clearcache(PyObject *self)
 {
-	if (cache != NULL)
-		PyDict_Clear(cache);
+	Py_CLEAR(cache);
 	Py_RETURN_NONE;
 }