[Python-checkins] bpo-39573: Update clinic to use Py_IS_TYPE() function (GH-18507)