Answer
Yes
Work Step by Step
Yes, it is possible that all of the heat absorbed by the gas is converted into mechanical work. For example, in an isothermal expansion, the heat added to the system to keep the temperature constant is completely used in doing work by the system.