All this stuff about guns and westerns is fine but doesn't get me any closer to what I'd like to know: how much mangling (beyond the obvious removal of ranged AoE damage spells) would it take to get D&D to work halfway well in an Age of Sail setting?
The answer is pretty much the same as for a Western - as much as you want to do.
Because you can do it in several different ways:-
1) You could transport regular D&D characters though a portal. In which case all you need to do is create stat blocks for the people and things on the other side.
2) You could use a real world setting with near-standard rules, limiting players to human-only low magic classes. Then you just need to tweak equipment lists and proficiencies. Firearms are martial weapons, two handed swords are not, rogues are proficient with firearms but not longswords. You
might go further and remove most armour, increasing the AC bonus for soft cover from +2 to +5.
3) You could do a complete reskin with all new setting specific classes: this option is a lot of work, you are basically creating a new game.
4) You could advance the technology level in your generic fantasy setting. In which case just add the new stuff and make it very slightly better than the old stuff (Players will choose any weapon they see as better, even if it's only +0.5 average damage better). See Pillars of Eternity 2.
5) You could advance the tech level but have magic instead of tech. This is Eberron, which works fine for both Western and Age of Sail adventures. You still have black hats and white hats shooting at each other from behind barrels, but they are shooting wands of Firebolt instead of sixguns. Also see: Harry Potter movies.