bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)



Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code.

CC @vstinner @encukou 


https://bugs.python.org/issue37645



Automerge-Triggered-By: @encukou
diff --git a/Include/cpython/object.h b/Include/cpython/object.h
index fd4e771..75e5599 100644
--- a/Include/cpython/object.h
+++ b/Include/cpython/object.h
@@ -348,6 +348,7 @@
 }
 #define _Py_Dealloc(op) _Py_Dealloc_inline(op)
 
+PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
 
 /* Safely decref `op` and set `op` to `op2`.
  *