bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)

diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 9e7e5f3..86dd277 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -439,8 +439,8 @@
 {
     if (self->ok && self->raw) {
         PyObject *r;
-        r = _PyObject_CallMethodIdObjArgs(self->raw, &PyId__dealloc_warn,
-                                          source, NULL);
+        r = _PyObject_CallMethodIdOneArg(self->raw, &PyId__dealloc_warn,
+                                         source);
         if (r)
             Py_DECREF(r);
         else
@@ -1323,7 +1323,7 @@
             goto end;
         Py_CLEAR(res);
     }
-    res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL);
+    res = _PyObject_CallMethodOneArg(self->raw, _PyIO_str_truncate, pos);
     if (res == NULL)
         goto end;
     /* Reset cached position */
@@ -1467,7 +1467,7 @@
        raised (see issue #10956).
     */
     do {
-        res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL);
+        res = _PyObject_CallMethodOneArg(self->raw, _PyIO_str_readinto, memobj);
     } while (res == NULL && _PyIO_trap_eintr());
     Py_DECREF(memobj);
     if (res == NULL)
@@ -1815,7 +1815,7 @@
     */
     do {
         errno = 0;
-        res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL);
+        res = _PyObject_CallMethodOneArg(self->raw, _PyIO_str_write, memobj);
         errnum = errno;
     } while (res == NULL && _PyIO_trap_eintr());
     Py_DECREF(memobj);
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 7f784a3..e4cbbfa 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -145,8 +145,8 @@
     PyObject *exc, *val, *tb;
     int rc;
     _Py_IDENTIFIER(close);
-    res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type,
-                                        &PyId_close, self, NULL);
+    res = _PyObject_CallMethodIdOneArg((PyObject*)&PyRawIOBase_Type,
+                                       &PyId_close, (PyObject *)self);
     if (!self->closefd) {
         self->fd = -1;
         return res;
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index ed1dc00..05911d9 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -977,8 +977,8 @@
 
     if (cmp == 0) {
         self->encoding_start_of_stream = 0;
-        PyObject *res = PyObject_CallMethodObjArgs(
-            self->encoder, _PyIO_str_setstate, _PyLong_Zero, NULL);
+        PyObject *res = _PyObject_CallMethodOneArg(
+            self->encoder, _PyIO_str_setstate, _PyLong_Zero);
         if (res == NULL) {
             return -1;
         }
@@ -1155,8 +1155,8 @@
         PyObject *locale_module = _PyIO_get_locale_module(state);
         if (locale_module == NULL)
             goto catch_ImportError;
-        self->encoding = _PyObject_CallMethodIdObjArgs(
-            locale_module, &PyId_getpreferredencoding, Py_False, NULL);
+        self->encoding = _PyObject_CallMethodIdOneArg(
+            locale_module, &PyId_getpreferredencoding, Py_False);
         Py_DECREF(locale_module);
         if (self->encoding == NULL) {
           catch_ImportError:
@@ -1597,8 +1597,7 @@
 
     PyObject *ret;
     do {
-        ret = PyObject_CallMethodObjArgs(self->buffer,
-                                         _PyIO_str_write, b, NULL);
+        ret = _PyObject_CallMethodOneArg(self->buffer, _PyIO_str_write, b);
     } while (ret == NULL && _PyIO_trap_eintr());
     Py_DECREF(b);
     if (ret == NULL)
@@ -1668,8 +1667,7 @@
         self->encoding_start_of_stream = 0;
     }
     else
-        b = PyObject_CallMethodObjArgs(self->encoder,
-                                       _PyIO_str_encode, text, NULL);
+        b = _PyObject_CallMethodOneArg(self->encoder, _PyIO_str_encode, text);
 
     Py_DECREF(text);
     if (b == NULL)
@@ -1851,9 +1849,9 @@
     if (chunk_size == NULL)
         goto fail;
 
-    input_chunk = PyObject_CallMethodObjArgs(self->buffer,
+    input_chunk = _PyObject_CallMethodOneArg(self->buffer,
         (self->has_read1 ? _PyIO_str_read1: _PyIO_str_read),
-        chunk_size, NULL);
+        chunk_size);
     Py_DECREF(chunk_size);
     if (input_chunk == NULL)
         goto fail;
@@ -2414,8 +2412,8 @@
         self->encoding_start_of_stream = 1;
     }
     else {
-        res = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_setstate,
-                                         _PyLong_Zero, NULL);
+        res = _PyObject_CallMethodOneArg(self->encoder, _PyIO_str_setstate,
+                                        _PyLong_Zero);
         self->encoding_start_of_stream = 0;
     }
     if (res == NULL)
@@ -2554,8 +2552,7 @@
     posobj = PyLong_FromOff_t(cookie.start_pos);
     if (posobj == NULL)
         goto fail;
-    res = PyObject_CallMethodObjArgs(self->buffer,
-                                     _PyIO_str_seek, posobj, NULL);
+    res = _PyObject_CallMethodOneArg(self->buffer, _PyIO_str_seek, posobj);
     Py_DECREF(posobj);
     if (res == NULL)
         goto fail;
@@ -2837,7 +2834,7 @@
     }
 
 finally:
-    res = _PyObject_CallMethodIdObjArgs(self->decoder, &PyId_setstate, saved_state, NULL);
+    res = _PyObject_CallMethodIdOneArg(self->decoder, &PyId_setstate, saved_state);
     Py_DECREF(saved_state);
     if (res == NULL)
         return NULL;
@@ -2851,7 +2848,7 @@
     if (saved_state) {
         PyObject *type, *value, *traceback;
         PyErr_Fetch(&type, &value, &traceback);
-        res = _PyObject_CallMethodIdObjArgs(self->decoder, &PyId_setstate, saved_state, NULL);
+        res = _PyObject_CallMethodIdOneArg(self->decoder, &PyId_setstate, saved_state);
         _PyErr_ChainExceptions(type, value, traceback);
         Py_DECREF(saved_state);
         Py_XDECREF(res);
@@ -2878,7 +2875,7 @@
         return NULL;
     Py_DECREF(res);
 
-    return PyObject_CallMethodObjArgs(self->buffer, _PyIO_str_truncate, pos, NULL);
+    return _PyObject_CallMethodOneArg(self->buffer, _PyIO_str_truncate, pos);
 }
 
 static PyObject *
@@ -3055,9 +3052,9 @@
     else {
         PyObject *exc = NULL, *val, *tb;
         if (self->finalizing) {
-            res = _PyObject_CallMethodIdObjArgs(self->buffer,
-                                                &PyId__dealloc_warn,
-                                                self, NULL);
+            res = _PyObject_CallMethodIdOneArg(self->buffer,
+                                              &PyId__dealloc_warn,
+                                              (PyObject *)self);
             if (res)
                 Py_DECREF(res);
             else
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index ea5d24f..f27a6dc 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -204,8 +204,8 @@
     PyObject *exc, *val, *tb;
     int rc;
     _Py_IDENTIFIER(close);
-    res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type,
-                                        &PyId_close, self, NULL);
+    res = _PyObject_CallMethodIdOneArg((PyObject*)&PyRawIOBase_Type,
+                                       &PyId_close, self);
     if (!self->closehandle) {
         self->handle = INVALID_HANDLE_VALUE;
         return res;