As a point of reference it's not hard to make Times iterative, you just need to put everything inside a single function call:
ClearAll[g] g[0, total_] := total; g[n_, total_] := g[n - 1, total*n] g[n_] := g[n, 1] Block[{$IterationLimit = 30000}, g[5000] === 5000! ] True