gh-92216: improve performance of `hasattr` for type objects (GH-99979)

4 files changed