PERF: cythonize entire core/internals.py to internals.pyx