16-18 inches of barrel? We are referring to a .38 vs .357 out of a 2'' pistol barrel. Another 2'' of barrel won't make much of a difference in muzzle velocity for a pistol, and a .357 slug is in no way made less potent in short barrel revolvers.
As for powder burn, the powder in that cartridge is burned up the moment it is ignited and creates a pulse of expanding gas -- not a stream of gas or a wave of gas, a single pulse which doesn't get any stronger. That pulse of gas (no longer burning gunpowder) pushes the bullet through the barrel and exits with it. A longer barrel doesn't increase the amount of pressure, though it allows the bullet to accelerate under that pressure for a little longer. Thus there is an optimal length of barrel depending on caliber under which the bullet receives optimum work from the expanding gases of the propellant before friction with the barrel actually does negative work and slows down the bullet before it reaches the end of the muzzle.
And, no, the gases don't stop expanding until they reach the same pressure of our atmosphere (e.g. not until long after that bullet as left the barrel because the gases aren't exposed to the atmosphere until they leave the barrel).
BTW, what is the difference in muzzle velocity out of a 2'' barrel and a 4'' barrel for a .357 magnum? 10 feet per second? There isn't a whole lot of difference. Chrono it yourself and see.