Boo, There may be some truth to the muffler further away from the heat source to help prevent afterfire. Have a customer with a Toro that always afterfired on shutoff didn't matter what you did. A few years ago it dropped a valve and damaged the head and piston. Replaced with a new engine, but used the old muffler from the prior engine, and on the first shut off after mowing. Bang. So the muffler can and will have something to do with the afterfire effect. Had a MTD several years ago in the shop that had the same issue, Replaced the muffler and no more afterfire.
In some cases even if the gas/air mix goes from the carb through the engine into the muffler, there may not be enough oxygen to ignite it until the muffler has had enough time for oxygen infiltration into the exhaust port to ignite the fuel. And today's hotter running engines just seem to make the problem worse.