Jefferson fought the Barbary pirates - they were muslims! I don’t think he exactly squared with the muslim faith.
But he did host the envoy, and change the dinner schedule to meet the Ramadan requirement.
And, IIRC, James Madison procured the escorts (concubines).
I believe it was a “to Serve Man” type of confusion when Obama read Jefferson served Muslims.