How Python have so long integer range?

Most programming languages offer integers based on the underlying CPU's machine word length, using single CPU instructions for e.g. add, in the interest of speed. It's always possible to provide a longer integer size by using multiple words and the carry/overflow flags in the hardware, but it's slower to do so and uses more memory.

This is very similar to how you do math on paper when you're given operands which are too big for you to multiply in your head.

Python prioritizes programmer convenience over raw speed, so it simply makes its integers as big as they need to be, on-demand.