Cache the sfPaymentRemaining proxy once instead of re-fetching it at
each of the three places it's read in the loop condition, the final-
payment assert, and the overpayment guard. It's a write-through proxy,
so it still reflects doPayment's mutations each iteration.
Also explicitly zero-initialize totalPaid so the starting baseline
isn't left implicit.