The NRA Dope Bag Technical Staff used a 36" Marlin Goose Gun, which they fired for velocity and pattern, then cut one inch off and re-tested. They continued in one inch increments down to 12".
Their results were:
Anything ballistically that's going to happen in a shotgun barrel happens within 18".
Barrel length has no effect on pattern. An 18" barrel will pattern just as good as a 36". Pattern is determined by the choke, not barrel length.
Anything over 28" and you start to loose velocity due to friction and powder burn rate.
Things "didn't get out of hand" until the barrel was down to 12".
The idea that a longer barrel will shoot "harder" or farther is a left over from black powder days when longer barrels burned the powder more efficiently.