This is a repost of a previous question, following the advice of an experienced user.
I was told that reversible processes are more efficient than irreversible ones, and that this fact is expressed in the inequality $\delta Q_{rev}\ge \delta Q_{ir}$ or $\delta W_{rev}\le \delta W_{ir}$, where $W$ stands for work. I'll write $\delta W$ instead of $\delta W_{rev}$.
My question is how do I compare a reversible process with an irreversible one? Let me explain what I mean. Textbooks say that expansion of a gas against zero pressure is zero, hence $\delta W\le \delta W_{ir}$ implies by integration that the work done by a reversible process should be negative. But between to states there are infinitely many processes, what are the processes that do negative work. Say the initial state is $(p_i,V_i)$ and the final $(p_f,V_f)$, where $V_f>V_i$, then the process depicted below does positive work.
Basically, you must expand the gas at very low temperature and compres it at high temperature. Even more, given any number $A$, there is a path exchanging $A$ Joules of work.
In general, given an irreversible process, how can I say what are the more efficient reversible processes?
I'd appreciate any help.