Slight nitpick: Using heat won't affect gas consumption of an ICE car. The heat is waste heat that otherwise would be dissipated through the radiator at the front of the car. Turning on the heat diverts coolant to a heat exchanger (tiny radiator) in the ventilation system that warms the air in the cabin.
However note that sometimes the A/C will be on at the same time as the heater in order to dry out the air.
This is one of those stupid facts that lives rent-free in my head. "If you want 'dry' hot air you need to dry it before sending it to the heater. The primary purpose of the A/C is to dry the air(this also happens to cool it), there is already an A/C unit in the ductwork, profit" But I decided to fact check myself and was not able to find much information. I did find one page that said this mainly occurs on the "defrost" setting, which makes sense as this is what is used when you don't want your windows to fog.
Regarding conditioning/drying the air instead of cooling it: the first modern air conditioners were invented primarily to dry the air, cooling was a side effect. The term "air conditioner" itself originally referred to moisture content as I understand it.