There's no difference at all between the 2nd and the 3rd versions. Choose one which is the shortest to type :)
There's a little difference between the 1st and the 3rd. You might prefer the 3rd if you are afraid of accidentally modifying a and b inside the function.