Well, if we're gonna toss the 2nd Law around...
Let's define an Initial State to be the chamber just after the firing of a cartridge. Both the barrel and the empty cartridge case have previously, and quite rapidly, absorbed a given amount of energy in the form of heat.
Final State: The emptied chamber.
Ejecting the fired case removes both the mass, as well as the energy that was stored within it.
The net result to the system is a loss of mass (the cartridge case), and a loss of energy (the heat associated with it). Had the case remained inside our system, the energy would have been primarily dissipated through the chamber walls. So by ejecting the case, there is less heat that must be transferred to the environment. (Well, there is less energy remaining inside of the system we defined as our chamber, anyway.)
Now how about someone calculate the entropy generated by the irreversibilities in the process, and then we'll call it a day.
This is how I would set up the situation, with some assumptions already included.
System: Open (Chamber)
Mass balance: [ dm/dt = d(mass;in - mass;out)/dt ] ===> [ dm/dt = d(-mass;out)/dt ]
1st law: [ dQ/dt - dW/dt - Σmass;out*(h;out) = dE/dt:system = dU/dt ]
2nd Law: [ Σ(dQ/dt)/T;0 - dS/dt;out + dS/dt;gen = dS/dt;system ]
What's the rub? Looking at what I have, I can't see how ejecting the case in any way increases the amount of energy in the chamber. And logically, that makes sense. So REMOVING the case does not make the chamber HOTTER.
What else? If anything, ejecting the case works to reduce the amount of energy in the chamber more rapidly than if we had just left the case inside, by reducing the total amount of energy in the system, and likely increasing the rate of heat transfer to the environment, even if only slightly.
Result? The chamber stays cooler if the case is removed. IMO.
Disclaimer: I'm not an expert, a lawyer, a robot, a... You get the idea.