This is the real layout of CPython's longobject.c and longintrepr.h — 30-bit digit limbs chosen specifically so intermediate multiplication never overflows a C long. The small-integer cache you're simulating (-5 to 256) is why 'a = 5; b = 5; print(a is b)' prints True in every real CPython interpreter, a quirk that trips up beginners debugging identity vs. equality.