bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)

diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h
index cf8c00c..4ced967 100644
--- a/Include/cpython/frameobject.h
+++ b/Include/cpython/frameobject.h
@@ -51,7 +51,7 @@
 
 PyAPI_DATA(PyTypeObject) PyFrame_Type;
 
-#define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type)
+#define PyFrame_Check(op) Py_IS_TYPE(op, &PyFrame_Type)
 
 PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
                                         PyObject *, PyObject *);