A novel representation for the free energy in string theory at non-zero temperature