Is there a way to ensure a function can't modify a parameter? - C#