Admittedly a crazy idea.
What if instead of going to war with the Barbary States, the new US formed an alliance with them?
In 1800, Napoleon doesn't take a conciliatory stance with the US, and the Quasi-War continues. Furthermore, over the next decade, Anglo-American relations continue to thaw leading up to the War of 1812.
Having poor relations with the European great powers, the US looks toward a new Old World trading partner--the Ottoman Empire. Instead of paying the ordinary tribute with the Barbary States (and then refusing this tribute, causing war) the US decides to negotiate a deal. The Americans buy European captives from the Barbary States as bonded or indentured servants, while selling cotton to the cotton-hungry Ottoman Empire and implicitly permitting the Barbary pirates to continue raiding Europe.
With freedom of religion guaranteed in the Constitution, aristocratic Moroccans, Algerians, Albanians, and Turks settle in the South and join the Southern planter class. They bring Greeks, Slavs, Armenians, and Copts as, essentially, serfs. Meanwhile, the Corsairs establish themselves in the collapsing Spanish Caribbean, bolstering the American arms industry, as the French and British are worn down by a lasting Continental System.