Something like this (yes, this doesn\'t deal with some edge cases - that\'s not the point):
int CountDigits(int num) { int count = 1;
If I don't need a copy of the original value, I don't declare a new variable.
IMO I don't think mutating the parameter values is a bad practice in general, it depends on how you're going to use it in your code.