remove some unnecessary overhead in typed Cython code