[DeepCompile] Fix staticmethod handling on Python 3.9 (#8240)