Rework PyAny::is_instance_of
for performance
#2881
Merged
PyAny::is_instance_of
for performance
#2881