There's no such thing as a 100% efficient "engine". But in this case, since the waste heat is put to use (heating the house), OP thinks there's a loophole.
But, house would also need to be soundproof. Any noise leaking to the outside is lost energy.
Ah, but that’s by design: it also acts as a soothing white noise machine.
Then you might point out the exhaust and all it’s associated wastes, but that’s by design: it produces a heady and aromatic product for recreational huffing.
Then you might point out the vibrations, but that’s by design: the engine also provides invigorating massages to relax taut muscles.
Most engines are less than 30% efficient at producing movement. The majority of the energy is lost as heat.
Thermodynamics tells us that pretty much all energy ends up as heat. In a closed system, any device that uses energy is 100% efficient at making heat. A 1000W computer will make exactly as much heat as a 1000W heater.
A 100% efficient engine can only exist if the desired output is heat, thus making it a pretty useless engine. Also, in a closed system, the exhaust cannot leave.
But even a furnace/fireplace is subject to incomplete combustion, where some portion of the wood is transformed into byproducts that rob some of the energy of the fire. There's actually a big difference in the amount of energy you can get out of a fire, depending on the type of stove that's used.
That's some of what NGOs have tried to do for developing countries - find cheap and easily produceabke stove designs that can reduce the amount of wood needed and improve air quality in the home.