bpo-37483: add _PyObject_CallOneArg() function (#14558)

diff --git a/Python/_warnings.c b/Python/_warnings.c
index 0b19258..b1762e6 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -590,7 +590,7 @@
     if (msg == NULL)
         goto error;
 
-    res = PyObject_CallFunctionObjArgs(show_fn, msg, NULL);
+    res = _PyObject_CallOneArg(show_fn, msg);
     Py_DECREF(show_fn);
     Py_DECREF(msg);
 
@@ -651,7 +651,7 @@
     }
     else {
         text = message;
-        message = PyObject_CallFunctionObjArgs(category, message, NULL);
+        message = _PyObject_CallOneArg(category, message);
         if (message == NULL)
             goto cleanup;
     }
@@ -996,7 +996,7 @@
         return NULL;
     }
     /* Call get_source() to get the source code. */
-    source = PyObject_CallFunctionObjArgs(get_source, module_name, NULL);
+    source = _PyObject_CallOneArg(get_source, module_name);
     Py_DECREF(get_source);
     Py_DECREF(module_name);
     if (!source) {
@@ -1283,7 +1283,7 @@
     int warned = 0;
     PyObject *fn = get_warnings_attr(&PyId__warn_unawaited_coroutine, 1);
     if (fn) {
-        PyObject *res = PyObject_CallFunctionObjArgs(fn, coro, NULL);
+        PyObject *res = _PyObject_CallOneArg(fn, coro);
         Py_DECREF(fn);
         if (res || PyErr_ExceptionMatches(PyExc_RuntimeWarning)) {
             warned = 1;
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 90fbb44..5de4363 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -29,7 +29,6 @@
 {
     Py_ssize_t i, j;
     PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
-    PyObject *stack[1] = {bases};
     assert(PyTuple_Check(bases));
 
     for (i = 0; i < nargs; i++) {
@@ -55,7 +54,7 @@
             }
             continue;
         }
-        new_base = _PyObject_FastCall(meth, stack, 1);
+        new_base = _PyObject_CallOneArg(meth, bases);
         Py_DECREF(meth);
         if (!new_base) {
             goto error;
@@ -574,7 +573,7 @@
             ok = PyObject_IsTrue(item);
         } else {
             PyObject *good;
-            good = PyObject_CallFunctionObjArgs(lz->func, item, NULL);
+            good = _PyObject_CallOneArg(lz->func, item);
             if (good == NULL) {
                 Py_DECREF(item);
                 return NULL;
@@ -1625,7 +1624,7 @@
     while (( item = PyIter_Next(it) )) {
         /* get the value from the key function */
         if (keyfunc != NULL) {
-            val = PyObject_CallFunctionObjArgs(keyfunc, item, NULL);
+            val = _PyObject_CallOneArg(keyfunc, item);
             if (val == NULL)
                 goto Fail_it_item;
         }
@@ -2178,7 +2177,7 @@
     if (ndigits == NULL || ndigits == Py_None)
         result = _PyObject_CallNoArg(round);
     else
-        result = PyObject_CallFunctionObjArgs(round, ndigits, NULL);
+        result = _PyObject_CallOneArg(round, ndigits);
     Py_DECREF(round);
     return result;
 }
diff --git a/Python/ceval.c b/Python/ceval.c
index 888749b..b0fd6ee 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1874,7 +1874,7 @@
                 Py_DECREF(value);
                 goto error;
             }
-            res = PyObject_CallFunctionObjArgs(hook, value, NULL);
+            res = _PyObject_CallOneArg(hook, value);
             Py_DECREF(value);
             if (res == NULL)
                 goto error;
diff --git a/Python/codecs.c b/Python/codecs.c
index d4b34f8..3865762 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -99,7 +99,7 @@
 
 PyObject *_PyCodec_Lookup(const char *encoding)
 {
-    PyObject *result, *args = NULL, *v;
+    PyObject *result, *v;
     Py_ssize_t i, len;
 
     if (encoding == NULL) {
@@ -132,13 +132,6 @@
     }
 
     /* Next, scan the search functions in order of registration */
-    args = PyTuple_New(1);
-    if (args == NULL) {
-        Py_DECREF(v);
-        return NULL;
-    }
-    PyTuple_SET_ITEM(args,0,v);
-
     len = PyList_Size(interp->codec_search_path);
     if (len < 0)
         goto onError;
@@ -155,7 +148,7 @@
         func = PyList_GetItem(interp->codec_search_path, i);
         if (func == NULL)
             goto onError;
-        result = PyEval_CallObject(func, args);
+        result = _PyObject_CallOneArg(func, v);
         if (result == NULL)
             goto onError;
         if (result == Py_None) {
@@ -182,11 +175,9 @@
         Py_DECREF(result);
         goto onError;
     }
-    Py_DECREF(args);
     return result;
 
  onError:
-    Py_XDECREF(args);
     return NULL;
 }
 
@@ -325,7 +316,7 @@
     if (errors != NULL)
         streamcodec = PyObject_CallFunction(codeccls, "Os", stream, errors);
     else
-        streamcodec = PyObject_CallFunctionObjArgs(codeccls, stream, NULL);
+        streamcodec = _PyObject_CallOneArg(codeccls, stream);
     Py_DECREF(codecs);
     return streamcodec;
 }
diff --git a/Python/errors.c b/Python/errors.c
index b3b9ac9..a7d40c1 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -93,7 +93,7 @@
         return PyObject_Call(exception, value, NULL);
     }
     else {
-        return PyObject_CallFunctionObjArgs(exception, value, NULL);
+        return _PyObject_CallOneArg(exception, value);
     }
 }
 
@@ -1381,8 +1381,7 @@
         hook_args = make_unraisable_hook_args(tstate, exc_type, exc_value,
                                               exc_tb, err_msg, obj);
         if (hook_args != NULL) {
-            PyObject *args[1] = {hook_args};
-            PyObject *res = _PyObject_FastCall(hook, args, 1);
+            PyObject *res = _PyObject_CallOneArg(hook, hook_args);
             Py_DECREF(hook_args);
             if (res != NULL) {
                 Py_DECREF(res);
diff --git a/Python/import.c b/Python/import.c
index 3937fbe..76866ae 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1180,7 +1180,7 @@
         PyObject *hook = PyList_GetItem(path_hooks, j);
         if (hook == NULL)
             return NULL;
-        importer = PyObject_CallFunctionObjArgs(hook, p, NULL);
+        importer = _PyObject_CallOneArg(hook, p);
         if (importer != NULL)
             break;