f[a, b] /. f[x__] -> g[x, 0] // InputForm (* Out: g[a, b, 0] *)
Which is what I expect, but when I use a built in symbol instead of
f, the result is different, for example:
Times[a, b] /. Times[x__] -> g[x, 0] // InputForm (* Out: g[a*b, 0] *)
How could I replace the multiplication in this case to get the same result as above?