exhaust pipe diameter for a mildly modified 340

I think it does, to a point. High velocity gasses exiting the exhaust will create some vacuum to help pull successive
exhaust pulses out and it also helps fill the next cylinder on the intake stroke.Think of an engine that has no exhaust pipe..the fumes would just come out of the valves and blat haphazard against the atmosphere. This is why tuned headers only work on long duration cams and why exhaust pipes that are too big hurt power.
For a street application and small cams this really only helps low speed power.
back pressure fights the exhaust from leavening the chamber.

Say you need a 2.5" pipe for zero back pressure, obviously a 4" pipe would have zero too but with less velocity.

Velocity is important but don't let it scare you into decision that strangle your engine that kill power overall.