This reduces the time spent in get_coverage from
~30% to ~2% in my local tests on Python3.