use Py_CLEAR
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 45f9f57..2292a9e 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -889,9 +889,7 @@
 static int
 sm_clear(staticmethod *sm)
 {
-    Py_XDECREF(sm->sm_callable);
-    sm->sm_callable = NULL;
-
+    Py_CLEAR(sm->sm_callable);
     return 0;
 }