The problem that you’re having, as you probably discovered, is that we don’t have a mutable forEach (see previous discussion: In-place map for MutableCollection)
So the only way to do this is to call forEach on the Collection’s indices and use the mutating subscript.
We should resurrect the previous discussion. You’re asking for something simple; it shouldn’t be this hard.