Mark source parameters to MC functions as const

This makes the usage of the functions clearer to the caller, clearly indicating which parameters will be changed by the functions. This can also possibly help the compiler optimize code around calls to such functions, knowing that these arrays are unchanged after the function call.