This is actually a really interesting potential pitfall of TDD that I don't think I've seen discussed before.
The idea that test design can actually constrain your solutions if your tests are too opinionated about implementation is fascinating.
Seems like maybe optimization needs to be a loop of "we optimize the code, then we optimize the tests"
Something to that effect.