It's not as far fetched as it seems. It's already law and it's constitutional.
Title 8, Section 1182
of the U.S. Code provides in relevant part:
Whenever the President finds that the entry of any aliens or of
any class of aliens into the United States would be detrimental to the
interests of the United States, he may by proclamation, and for such
period as he shall deem necessary, suspend the entry of all aliens or
any class of aliens as immigrants or nonimmigrants, or impose on the
entry of aliens any restrictions he may deem to be appropriate.
And if he calls it a temporary hiatus, similar to a temporary tax or
some such, he sounds positively reasonable. Prez O'Bungler could issue one of his famous executive orders right now restricting immigrants from Syria to Muslims only.