Thanks a lot for the helpful comments. I've started downloading old Python versions, one from every year between 2015 up till now. And to my pleasant surprise, it compiles perfectly with Python 3.11.