Is there any feasible way to have a Muslim president of the United States before 1900? I suppose that if Orientalism had been more popular in the early United States, some ex-Deists could have converted to Islam due to the declining popularity of the Enlightenment and the appeal of the imagined Orient. It also could have become something of a political statement among the upper class of the Antebellum South as a reaction against Jacksonian populism and supposedly plebeian politics.
So, is this a thing that could have happened or should I prepare my straitjacket and tinfoil hat?
You would need more muslims, especially white muslims, for this to work out.
The Barbary Wars with Tripolitania and Algiers end more in the US's favor, resulting in the US getting a series of china-style concessions in various Maghrebi cities (Tripoli, Oran, Algiers, Benghazi, etc). American merchant and trading companies start spending a lot of time on these areas, and due to the already positive American-Moroccan relationship Morocco opens up more to US trade as well. North African traders start heading to the US as well. A small trickle of North Africans start immigrating to the US, and over time it becomes a norm for North African nobles and elites to send their children to American schools.
When France takes over Algeria, a large number of Algerians proceed to emigrate to the United States. Islam in the US is primarily seen as a religion of merchants and nobles as they comprise a disproportionate amount of the muslim population of the US. The knock-on effect is that during the second great awakening many people embrace Islam - the US population ends up 7% or 8% muslim by the mid-19th century. In the late 19th century, a muslim is elected US president.