Make pass-by-ref arguments const.

Make some of the arguments in rest.cpp, that are passed by
reference but never modified, const to emphasise that.
Merge pull request #5484

7c8e4c5 Make pass-by-ref arguments const. (Daniel Kraft)