No, the solution is to move the water and have the swimming equivalent of a treadmill. NB: this already actually exists, only remember seeing it in a video at some point though.
You probably saw it in person as well, it's called a river :) In Zurich there's multiple places where you can swim in the Limmat, and it takes quite some effort to stay in place - one example is https://images.app.goo.gl/qTASdR51yDTiCk299 (of course you could go without the installation but this allows people to use it that would be afraid of getting carried away ...)
The problem with this is that the current is constant. When doing a long set I sometimes accent the arms and the legs alternately over say 200m. Well typically three lengths of arms and one length of kick dominated effort. The thing is the speed does change from one technique to other but moving the water at a constant speed over a short distance doesn't work properly. So it's cute for a little swimming but it's not compelling for serious training. Never mind if you want try doing an individual medley set.
That's true. The motivation for the swimmer is to not get sucked into the intake. I can hear the coach laughing maniacally as he turns the speed up to 11.