Continuity and boundary conditions in thermodynamics: From Carnot’s efficiency to efficiencies at maximum power