Change some pass-by-value to pass-by-ref, very slight but measurable speedup

I noticed that some functions we call when transforming vectors by matrices were written with pass-by-value rather than using const&. Changing resulted in a measurable (though small) speedup in benchmarks.