As I know, using different sign convention in chemistry and physics(especially engineering) arises from difference of interest. Chemists focus on the system itself where chemical reactions occur, but engineers pay attention to things the system makes.
If we choose the formula, [itex]dW=-P_{\mathrm{ex}}dV[/itex], then we regard energy transfers(in the form of work or heat to change the internal energy) coming in the system as postive(negative, otherwise). Thus, we should consider [itex]-W[/itex] if we want to talk about effects the system makes on the surrounding.
I guess Mahan's book explains two processes, nearly the isothermal expansion and compression. Let's check the expansion case first.
It is obvious that [itex]P_{\mathrm{int}} \geq P_{\mathrm{ex}}[/itex] (otherwise expansion won't occur) ,where the equality is satisfied in a reversible process. Integrating from [itex]V_{1}[/itex] to [itex]V_{2}[/itex] makes
[tex] W_{\mathrm{rev}}=-\int_{V_{1}}^{V_{2}} P_{\mathrm{int}} \mathrm{d}V \leq -\int_{V_{1}}^{V_{2}} P_{\mathrm{ext}} \mathrm{d}V = W_{\mathrm{irrev}} [/tex]
However, we should note the sign of those quantities, [itex]W_{\mathrm{rev}} \leq W_{\mathrm{irrev}} <0 [/itex]. The system pushes the surrounding making it shrinked in the expansion process. That makes the system use its internal energy to the surrounding in the form of work, which is expressed as (-) sign.
The statement that work done for a reversible process is maximum is right when considering the work done by the system on the surrounding (energy transfer out of the system). Therefore, work done in a reversible process is larger than one in a irreversible process, i.e. [itex] -W_{\mathrm{rev}} \geq -W_{\mathrm{irrev}} >0 [/itex].
Then move on the case of compression. Obviously, [itex]P_{\mathrm{int}} \leq P_{\mathrm{ex}}[/itex] ,where the equality is satisfied in a reversible process. Then
[tex] W_{\mathrm{rev}}=-\int_{V_{2}}^{V_{1}} P_{\mathrm{int}} \mathrm{d}V \leq -\int_{V_{2}}^{V_{1}} P_{\mathrm{ext}} \mathrm{d}V = W_{\mathrm{irrev}} [/tex]
Now we get [itex]0<W_{\mathrm{rev}} \leq W_{\mathrm{irrev}} [/itex]. We can explain it reversely like: The surrounding pushes the system making it shrinked in the compression process. That makes the system given energy from the surrounding in the form of work, which is expressed as (+) sign.
In the view of the surrounding, the system steals its energy in the form of work, and the amount stolen is also expressed as [itex]-W [/itex]. Consequently, we get the conclusion, [itex] 0>-W_{\mathrm{rev}} \geq -W_{\mathrm{irrev}} [/itex].
I edited some mistakes.