Let me add couple of words.
First, I would recommend never look at wikipedia. There are SO MANY errors in it, that one cannot distinguish what is true and what is not. I have checked randomly articles on Physics and Math. My estimate that about 30% have factual errors or simply wrong. I forbid my student to use it (or at least, if they use it I will not accept as an excuse if they make errors due to wikipedia).
Second, in your first example the piston is indeed can transfer 100% heat into work. Nothing forbids that. What physicists mean by "efficiency cannot be more than 1-T2/T1" is no engine can transfer more than 1-T2/T1 (even in IDEAL model, with no friction, etc.) into work if the engine (actually its working body, like gas, etc) returns into initial state. If you push (very slowly to keep the pressure constant) your pistol back, you need to do some work (so, you prefer to lower the temperature inside of cylinder to decrease the pressure and therefore the work you need to push the piston back). That work should be subtracted from the work you received in the first part of the cycle. The first part work depends upon the high temperature (temperature of expansion), while the second (actually the third) part work depends upon the low temperature. So, the efficiency depends upon both.
Third, it is not really matters if the process reversible or not. If the process is ideal and reversible, the engine may reach the 1-T2/T1 efficiency, while if the process is not reversible (like real-life processes), the efficiency cannot reach it in principle, it will be always lower.
Fourth, everything above applies to ideal processes (no friction, etc.). If there are un-idealities (friction, heat loss, etc.) the efficiency will drop even for Carnot cycle (which has FOUR reversible steps).
If you want to follow, just send me an e-mail, as I might not check the forum often.