The two arguments aren't exactly equivalent. Gun buyers are US citizens have a lot of rights and obligations from the government. Immigrants are not citizens and don't have any rights or obligations to fairness from the government. We already have very different rules for immigrants from different countries. A Canadian can get into the country much easier than other countries for example.
I don't personally support banning Muslims because the terrorism is so low it's not worth worrying about. But one could imagine if it got much higher and was a legitimate large threat. Then I would be completely ok with banning Muslims.
You might be correct that the country doesn't have a constitutional obligation to non-citizens (although courts have ruled that non-citizens do have SOME rights when they are in the country), I was saying the liberal position is that we SHOULD have obligations to all people of the world to be treated fairly.
I don't personally support banning Muslims because the terrorism is so low it's not worth worrying about. But one could imagine if it got much higher and was a legitimate large threat. Then I would be completely ok with banning Muslims.