tankless heaters use slightly less energy, but they use it in a really annoying way. the optimal design for a heavily renewable grid is a heat pump water heater with a tank
Regardless the point is eliminating the use of natural gas in heating water is itself a benefit.
Summary the more hot water you use the smaller the win is for tankless.
Other thing I've read and seems true is gas and heat pump water heaters cost about the same to run. I installed a heat pump unit five years ago. Works okay for two people. If you had three teenage girls and a wife that likes baths a tankless would be a better choice.