Simple thermodynamics. You apply x joules of heat to the heating element, and almost all of that is transferred to the pool. Some is lost to the material surrounding the pump and pipes, but higher flow rate actually minimizes that.
That applies no matter how high the flow rate is
So higher flow rate actually increases the heat transfer, for several reasons:
1. less heat loss to the material surrounding the pump and pipes.
2. more heat generated due to the increased friction and turbulence.
And there is no upper limit, before other factors come into play, such as flow rate in the pipes hitting the speed of sound, or cavitation in the pump, both of which limit the flow rate, but also generate heat.
edit, and of course you cannot increase the speed without limit. Speed of sound comes into play, as does pump problems. What does cost of electricity have to do with this, since you are assuming a fixed heater capacity?