Thermodynamic costs of Turing machines