It seems that so far, the only module that uses dynamic types with Argument Clinic's subclass_of is _ssl [and now sqlite], and AFAICS, it does things by walking the MRO twice. It might be worth it to add better support for this need. For example, I could imagine checking if any superclass was defined using a given PyType_Spec.
From https://github.com/python/cpython/pull/26537#issuecomment-856777442: