The government may not criminally punish immigrants based on speech that would be protected if said by a citizen.[83] On entry across borders, the government may bar non-citizens from the United States based on their speech, even if that speech would have been protected if said by a citizen.[84] Speech rules as to deportation, on the other hand, are unclear.[85] Lower courts are divided on the question, while the leading cases on the subject are from the Red Scare.
Relevant section on Wikipedia:
https://en.wikipedia.org/wiki/United_States_free_speech_exceptions
Regarding the protections against illegal searches, I think all bets are off, even for US citizens.