Restrict co_code to be under INT_MAX in codeobject by ammaraskar · Pull Request #20628 · python/cpython
Based on @vstinner's advice from #20590 (comment)
This assumption already exists in the interpreter: https://github.com/python/cpython/blob/master/Python/ceval.c#L1328
I checked PyBytes_GET_SIZE(x) directly instead of PyBytes_GET_SIZE(x)/sizeof(_Py_CODEUNIT) just like ceval, since presumably the smallest size of 1 for _Py_CODEUNIT would still allow co_code to be fully indexable with an int.