In an isothermal process, all the heat that enters the system is transformed into work. However, doesn’t the second law of thermodynamics prohibit this? I thought that it is impossible to convert heat entirely into work, and yet an isothermal process seems to accomplish this. If there are processes out there that can convert heat entirely into work, then why do physicists theorize that heat death will occur?
No, the second law of thermodynamics prohibits processes where the heat is transformed into work and this is the only effect of the process.
In this situation we have a gas which expands and performs the work and the heater. Some heat was taken from heater and transformed into work. Entropy of heater decreased. But the gas has expanded! Even though its energy and temperature remained unchanged, its volume has increased, and so its entropy has increased. So, the transform of heat to work was not the only effect of the process, and the second law of thermodynamics does not prohibit it.
To complement lesnik's answer, think of an everyday example such as a glass of water with ice. Let's say you isolate it and let it reach the thermal equilibrium. The temperature of the mix will be 0 degrees Celsius. If this system stops being isolated (being somewhere at room temperature, for example), an isothermal process will occur: all the heat that enters the system will be used to transform ice into liquid water. While there is any ice remaining the temperature of the mix will be 0 degrees.