[ADT] Add `sum_of` and `product_of` accumulate wrappers (#162129)
Also extend the `accumulate` wrapper to accept a binary operator.
The goal is to the most common usage of `std::accumulate` across the
codebase -- calculating either the sum of or the product of all values.