vec: make the move iterator fast for all types

Closes #10976

Taken from 863fbaaa125f1bb290e28cbf22236406cf0aebcf, and will be easily updated to a saner vector representation.