This implements a modification of the proposal in #22007: instead of adding outputs to the set of outputs in the original transaction, the outputs given by outputs
argument completely replace the outputs in the original transaction.
As noted below, this makes it easier to “cancel” a transaction or to reduce the amounts in the outputs, which is not the case with the original proposal in #22007, but it seems from the discussion in this PR that the replace behavior is more desirable than add one.