Is there any reason this can't be written in pure ruby? In general if a method invokes `invoke_block` in a loop we want it to be Ruby so the JIT can inline it all.