Discharge has a slightly different reason for straight run, which we call a "flow run", but some pumps do not need that flow run, it really depends on the pump.
Here are some of the things to know:
If pump has a diffuser, then flow run may not be necessary.
Speaking specifically of pumps with Ns<6000, no diffuser, and discharge connection is close to the impeller, such as scroll type single and double volute pumps, they usually require some flow run.
Straight volute pumps (with no diffuser) have very high velocities at the discharge. Energy transfer from the pump shaft into the fluid is almost entirely by an increase in velocity, and then this high velocity energy must be converted into pressure energy by slowing the fluid down. Now the little known fact, this "slow down" or conversion of energy, from velocity to pressure, in many cases is accomplished after the fluid leaves the pump and enters the pipe system which is most often larger size than discharge nozzle, i.e. system resistance in the pipe system causes reduction in velocity. If you allow a fast turn just after pump discharge the high velocity fluid hits that ell or tee and can not only eat out that fitting, but also fluid may re-enter the discharge nozzle of the pump, called discharge recirculation and also discharge recirculation cavitation. Heck, even with a flow run you can have discharge recirculation at low flow rates.
A video for discharge recirculation at this link:
PUMPDESIGNER