Assuming an 84% efficient 400,000 btu/hr heater, the water will gain 336,000 btu per hour.
At 40 gpm, the water exiting the heater will be about 16.8 degrees Fahrenheit warmer than the water entering. Let's assume 70 degrees in and 86.8 degrees out.
At 80 gpm, the water exiting the heater will be about 8.4 degrees warmer than the water entering the heater. So, 70 degrees in and 78.4 degrees out.
Heat transfer depends on the difference between the exhaust temperature and the water temperature (among other things).
Natural gas burns at 3,542 degrees Fahrenheit. The exhaust temperature depends on the air flow rate.
The exhaust temperature exiting the heater is in the 300 to 350 range after 84% of the heat is transferred to the water, which means that the exhaust temperature is substantially higher when it makes contact with the heat exchanger.
Assuming that the exhaust temperature is about 1767 degrees Fahrenheit before it hits the heat exchanger, the temperature difference between the water and exhaust is so large that the slower flow will still gain more than 99.5% of the heat that the higher flow would get.
So, the temperature difference of 8.4 degrees will only have a very minor effect on the efficiency of the heat transfer.
In addition, once you exceed 40 gpm, a substantial amount of the flow begins to go through the internal bypass, which means that you probably wouldn't get more than 50 gpm going through the heat exchanger even if the flow going to the heater was 80 gpm.
The main thing to do is to keep the flow within the specifications as listed in the manual.
My recommendation is to stay close to the lower end as higher flow confers little to no benefit.