Hot water lines always need to keep the heat in the tank by avoiding heat escaping by thermo-siphoning.
A simple thermal method is called a pipe Heat Trap. It works on the principal that heat does not travel down because it is lighter or buoyant, like air bubbles.
Another type, below, is a 2.5 inch nipple with a one-way ball that blocks water like a check valve from thermal back-flow. This mechanical valve type works well when the pipes come out the top of the tank and continue up, some brands can work horizontally but generally avoid horizontal use of this type.
Avoiding heat traps can lose a lot of heat from a tank into the surrounding area, especially cold areas with long copper pipes.
A SunPump 2.3 showing the initial downward direction to avoid heat loss.