Clarification on the Clausius inequality
Denbigh, in his book the Principles of Chemical Equilibrium, considers the case where "(a)the only heat transferred to the system is from a reservoir which remains at the constant temperature T; (b) the initial and final temperatures of the system are equal, and are equal to the temperature T of the reservoir; (c) apart from the system, the only other body with has undergone a change of volume at the end of the process is at a constant pressure p (e.g. a surrounding fluid such as the atmosphere); (d) the initial and final pressures are equal, and are equal to p."

For this situation, from the first law, we have
$$\Delta U=q-w$$ so that, from the definition of Gibbs free energy, it follows that:  $$\Delta G=q-w+p\Delta V-T\Delta S$$
Applying the Clausius inequality to this situation yields:
$$\Delta S=\frac{q}{T}+\sigma$$where $\sigma\geq0$ is the entropy generated, with the = sign applying if the process is reversible and the > sign applying if the process is irreversible or spontaneous.  If we combine the previous two equations, we obtain:$$w=-\Delta G+p\Delta V-T\sigma$$ So, for any process path between two specified end states of a system under these pressure and temperature constraints, the maximum work over and above p-V work is $-\Delta G$, and all other irreversible cases will involve less work (over and above $p\Delta V$).