Add METH_FASTCALL calling convention

Issue #27810: Add a new calling convention for C functions:

    PyObject* func(PyObject *self, PyObject **args,
                   Py_ssize_t nargs, PyObject *kwnames);

Where args is a C array of positional arguments followed by values of keyword
arguments. nargs is the number of positional arguments, kwnames are keys of
keyword arguments. kwnames can be NULL.
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 0fe3315..487ccd7 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -97,6 +97,11 @@
     if (flags == (METH_VARARGS | METH_KEYWORDS)) {
         res = (*(PyCFunctionWithKeywords)meth)(self, args, kwds);
     }
+    else if (flags == METH_FASTCALL) {
+        PyObject **stack = &PyTuple_GET_ITEM(args, 0);
+        Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+        res = _PyCFunction_FastCallDict(func, stack, nargs, kwds);
+    }
     else {
         if (kwds != NULL && PyDict_Size(kwds) != 0) {
             PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
@@ -232,6 +237,25 @@
         break;
     }
 
+    case METH_FASTCALL:
+    {
+        PyObject **stack;
+        PyObject *kwnames;
+        _PyCFunctionFast fastmeth = (_PyCFunctionFast)meth;
+
+        stack = _PyStack_UnpackDict(args, nargs, kwargs, &kwnames, func_obj);
+        if (stack == NULL) {
+            return NULL;
+        }
+
+        result = (*fastmeth) (self, stack, nargs, kwnames);
+        if (stack != args) {
+            PyMem_Free(stack);
+        }
+        Py_XDECREF(kwnames);
+        break;
+    }
+
     default:
         PyErr_SetString(PyExc_SystemError,
                         "Bad call flags in PyCFunction_Call. "