Impact works better than continuous high torque to break threads loose without tearing equipment apart. Anything you can get a socket on can have the socket driven by an impact wrench... but don't overdo it!
Heating only the nut works well because the nut expands (with increased temperature) more than the bolt or stud it's on. In the case of the heater's anode, you would want to heat the tank (the part on the outside of the threads) more than the anode, which might be tough.I find a quick targeted heat on the side of the nut to be more effective than a lower diffuse heat of a heat gun. I zap it for a few seconds, only to heat the nut. I not worried that the heat is on long enough to reach of damage other items.