Compute reverse-time discounted returns from a reward sequence using a configurable discount factor and terminal bootstrap.