edit: I was wrong, it mostly applies to everyone [0]
[0] https://scholarship.law.georgetown.edu/cgi/viewcontent.cgi?a...
It's not even hard to find legal scholar opinions stating such:
https://victormalcalaw.com/do-non-citizens-have-constitution...
https://www.learnliberty.org/blog/t-he-constitutional-rights...
Guantanamo Bay being a violation of due process and habeus corpus is one of the big problems with it. The problem is that it's excruciatingly difficult to have standing and jurisdiction in these cases, which is one of the ways the government skirts accountability.
Edit: I replied before your edit; I will leave this comment as-is, however.
There is a concern that government will make their judgments based on something other than illegal speech, but that is a larger concern with the government in general and selective enforcement of laws. Consider the guy who was publishing 3d weapon designs. Officially he wasn't punished for his speech but for other crimes (which just so happens to be one of the few strict liability crimes so the government doesn't have to prove mens rea), but he was given special focus that appears to have been because of his legal speech. Selective enforcement of laws already leads to a chilling effect on speech that is a much larger concern as it impacts all citizens, residents, immigrants, and potentials thereof, not just visa applicants.
For example rape is illegal, and collecting DNA samples at the border might deter or detect rapists. Some drugs are illegal, and hair sample drug tests might deter or detect drug users. Money laundering is illegal, and requiring online banking credentials be handed over might deter or detect money launderers.
As it's at the border, there would be no constitutional concerns.
And yet we don't do these things - why do you think that is?
>Money laundering is illegal, and requiring online banking credentials be handed over would deter money launderers.
We do far more than that to stop money laundering and not merely at the border.
To say nothing of the many other types of searches we already perform at the border.