Wouldn’t it be more efficient to use unvented heaters so heat wouldn’t be lost out the flue?

No. The National Fuel Gas Code (NFPA54) and local codes require a minimum ventilation flow of 4 CFM per 1000 Btu/hr of heater input by either mechanical or gravity ventilation if the heaters themselves are not vented to the outside. This additional ventilation requirement increases the building heat loss and the fuel cost as indicated in this example:

Temperature Differential (inside temp less outside design temp) 65° F
Building Heat Loss 125,000 Btu/hr
Infrared Compensation Factor (based on 16′ mounting height) 0.80
Infrared Heat Required 100,000 Btu/hr
Vented Unvented
Input 100,000 Btu/hr 100,000 Btu/hr
Additional Ventilation Required: 0 CFM 4 CFM per 1000 Btu/hr = 400 CFM
Heat Loss Due to Ventilation 0 Btu/hr Q = CFM x 60 min/hr x TD x 0.018 400x60x65°x0.018=28,080 Btu/hr
Total Input Required 100,000 Btu/hr 128,080 Btu/hr