Bazel client: reduce mutability
Bazel client: reduce mutability

Use some final values instead of mutating a
struct's state. This makes the code easier to
read.

Closes #9231.

PiperOrigin-RevId: 265438123

perezd/bazel,perezd/bazel,twitter-forks/bazel,ulfjack/bazel,katre/bazel,dslomov/bazel,cushon/bazel,katre/bazel,meteorcloudy/bazel,safarmer/bazel,ButterflyNetwork/bazel,davidzchen/bazel,bazelbuild/bazel,dslomov/bazel,dslomov/bazel-windows,safarmer/bazel,aehlig/bazel,werkt/bazel,aehlig/bazel,dslomov/bazel-windows,meteorcloudy/bazel,dslomov/bazel-windows,safarmer/bazel,davidzchen/bazel,ulfjack/bazel,aehlig/bazel,akira-baruah/bazel,akira-baruah/bazel,perezd/bazel,cushon/bazel,dslomov/bazel,akira-baruah/bazel,werkt/bazel,cushon/bazel,akira-baruah/bazel,bazelbuild/bazel,davidzchen/bazel,katre/bazel,safarmer/bazel,safarmer/bazel,aehlig/bazel,ulfjack/bazel,katre/bazel,twitter-forks/bazel,twitter-forks/bazel,dslomov/bazel,meteorcloudy/bazel,twitter-forks/bazel,katre/bazel,dslomov/bazel,cushon/bazel,safarmer/bazel,bazelbuild/bazel,cushon/bazel,bazelbuild/bazel,dslomov/bazel-windows,meteorcloudy/bazel,werkt/bazel,dslomov/bazel,aehlig/bazel,ulfjack/bazel,werkt/bazel,ButterflyNetwork/bazel,ulfjack/bazel,katre/bazel,perezd/bazel,bazelbuild/bazel,davidzchen/bazel,akira-baruah/bazel,ulfjack/bazel,perezd/bazel,werkt/bazel,ButterflyNetwork/bazel,davidzchen/bazel,aehlig/bazel,bazelbuild/bazel,meteorcloudy/bazel,werkt/bazel,akira-baruah/bazel,dslomov/bazel-windows,meteorcloudy/bazel,ButterflyNetwork/bazel,ButterflyNetwork/bazel,twitter-forks/bazel,perezd/bazel,perezd/bazel,twitter-forks/bazel,davidzchen/bazel,twitter-forks/bazel,ulfjack/bazel,davidzchen/bazel,dslomov/bazel-windows,cushon/bazel,meteorcloudy/bazel,ButterflyNetwork/bazel,dslomov/bazel,aehlig/bazel