Hi fab. I think it's best to take an overall look at what energy is going in and what energy is going out. To do this, let's put a control volume around the entire compressor, including all utilities used. If we apply he first law of thermodynamics and simplify, we find:
dU = Hin - Hout + Win - Qout
Where
dU = 0 for a steady state system
Hin = Enthalpy entering the compressor determined by the state of the gas
Hout = Enthalpy coming out of the compressor determined by the state of the gas
Win = Work going in such as electricity or shaft work
Qout = Heat being rejected
Generally, the compressor system rejectes heat such that the gas leaving the compressor is at aproximately the same temperature as the gas entering. For example, an air compressor taking ambient temperature air at 70 F and compressing it isentropically to 100 psig will result in the air temperature climbing to 489 F. But before we discharge that gas, a compressor will typically cool it back down to roughly ambient temperature. If 1 lbm/s of air is compressed this way isentropically, that compressor requires 144 hp of power to operate. This 144 hp is the work per unit time entering the control volume in the form of electricity or shaft work assuming no losses to friction or other factors.
So we put 144 hp into 1 lbm/s of air at 70 F and 0 psig, and we get 100 psig out at 489 F. But before we allow that air to continue down the pipe, we must cool it back down to 70 F. The heat we remove is the Qout in the above equation. The energy removed per unit time equates to a power which we might want to compare to the 144 hp power input. We might then say that the energy of this system in the form of the gas coming out, minus the energy of the gas going in, plus the power going in, is equal to the heat rejected.
Qout = Hout - Hin - Win
We might say this heat represents all that energy that "is being lost or maybe not fully used". If all the work put in, stayed in the gas, the temperature of the gas would be 489 F, but there is heat rejected, so that much energy is 'lost' so to speak. That of course, assumes we have 100% isentropic efficiency. So how much heat must be rejected? How much power do we loose by cooling the air back down?
Guess what… Heat out equals work in for an ideal gas, and for this particular example, very slightly more heat is rejected than work in! Heat removed is roughly 0.7% more than work in - not much but the point is the heat out is roughly equal to the work in. I know that seems funny, but it's true. The amount of heat rejected is often slightly larger than the work put in. Another way of loooking at it is that the enthalpy of the air exiting the compressor at 100 psig and 70 F is actually less than the enthalpy of the air going into the compressor at 0 psig and 70 F. So we put all this work into compressing the air, but we also take out heat at a rate roughly equal to, or even slightly faster than, the work we put in.
If the isentropic efficiency is less than 100%, even more energy in the form of heat must be removed when compared to work in. This gets back to my original question, are you interested in this additional loss, or are you more interested in the overall energy balance? As you can see, the energy put into the gas is going to be roughly equal to the energy in the form of heat that must be rejected.