The Constitution does indeed provide freedom of religion. I don't think the founders envisioned a religion that kills people by the score. I guess a "moderate" solution might be to give them a choice; renounce Islam or leave peacefully. There are many Islamic paradises they can go to. They can't have ours.
They knew VERY WELL about the Barbary pirates, the Saracens and the Turk. They just did not envision that these characters will be invited to America.