Doesn't the Python VM have inline caches? [0]
https://en.wikipedia.org/wiki/Inline_caching
It didn't used to.
EDIT: python 3.11+: https://peps.python.org/pep-0659/
It didn't used to.
EDIT: python 3.11+: https://peps.python.org/pep-0659/