When that absolute worst case is happening in the house's living space, we can and do "convert" heat to electrical energy savings 1:1, because every joule "wasted" by cooking food with gas, or heating the house with a corn stove, or warming up the floor with sunlight for passive solar gain, is another joule earlier that the space heater's thermostat will turn it off.
Also, I don't think it's accurate to describe electrical resistance heating as "the thermodynamically worst heating technology possible". Electrical resistance heating is generally close to 100% efficient. It's actually thermodynamically possible to make heaters that are less than 100% efficient; MacKay explains, for example, that he heats his house with a 90%-efficient condensing boiler, and it's common for fireplaces to be around 20% efficient, because most of the heat goes up the chimney instead of heating your house.
Fireplaces are actually thermodynamically possible machines. I understand that you've never seen one, but I assure you that they do exist.
I've actually lived in houses where the fireplace had negative efficiency at times, sucking more heat out of the house (in the form of warm air) than they added back in the form of radiation.