Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
diff --git a/Python/ceval.c b/Python/ceval.c
index 4fcf25e..6e5e272 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4360,8 +4360,7 @@
             Py_INCREF(self);
             func = PyMethod_GET_FUNCTION(func);
             Py_INCREF(func);
-            Py_DECREF(*pfunc);
-            *pfunc = self;
+            Py_SETREF(*pfunc, self);
             na++;
             n++;
         } else