Put timeseries into an array first. Let's assume the values of timeseries are my_array. Then,
import numpy as np
s = np.cumsum(my_array) - rate
s[s < 0] = 0
new_timeseries = s
UPDATE: this is not right. It doesn't account for zeroing the cumsum when s the increment is below the rate. You can find the points where the cumsum is below rate with the derivative:
In [1]: dd = np.diff(np.cumsum(my_array))
In [2]: dd < rate
Out[3]: array([ True, False, True, False, False, True, True,
True, True, False, True, False, True, False,
True, True, True, False, False], dtype=bool)
However, this doesn't 'reset' the cumsum. One could hunt along those indices and do a cumsum in blocks of 'Trues', but I'm not sure if it would be more efficient than your loop.