This is like a booby trap in a language. Presumably it can be solved with optimization in the compiler at some point (according to the thread, turning on optimizations improved performance somewhat, but replacing for with while made performance identical to Java).
Personally, I don't like languages to have a whole bunch of slightly different iterators for specialized purposes, but having for turn out to be dramatically different from while performance-wise violates the principle of least surprise.