The question is very simple: does the free speech protection provided by the First Amendment apply to non US citizens and does it apply anywhere, outside US territory, protecting these people as strongly as US citizens on US territory from US laws restricting speech?
Speech of foreign nationals is not treated the same as that of citizens.
In the case Buckley v. Valeo, 424 U.S. 1, the Supreme Court rules on the constitutionality of various statutory limits on campaign spending. Some parts of the law were upheld, others were overturned in 1st Amendment grounds. They upheld limits on contributions to candidates and volunteers' incidental expenses, and overturned limits on expenditures. In the decision, the court observed that
[n]either the right to associate nor the right to participate in political activities is absolute
"governmental 'action which may have the effect of curtailing the freedom to associate is subject to the closest scrutiny'"
The court stated that
Even a 'significant interference with protected rights of political association' may be sustained if the State demonstrates a sufficiently important interest and employs means closely drawn to avoid unnecessary abridgment of associational freedoms.
This is reasonably-standard strict scrutiny boilerplate language: what it remind you is that no Constitutionally-protected right is absolute, and all rights are subject to limitation, when that right conflicts with a compelling government interest. In the case of the federal contribution laws, that interest
is the prevention of corruption and the appearance of corruption spawned by the real or imagined coercive influence of large financial contributions on candidates' positions and on their actions if elected to office.
The court then found that
under the rigorous standard of review established by our prior decisions, the weighty interests served by restricting the size of financial contributions to political candidates are sufficient to justify the limited effect upon First Amendment freedoms caused by the $1,000 contribution ceiling.
52 USC 30121 imposes a prohibition which, if placed on US persons, would be held to violate the 1st Amendment. That law prohibits, among others,
a contribution or donation of money or other thing of value, or to make an express or implied promise to make a contribution or donation, in connection with a Federal, State, or local election
by "a foreign national", defined to not include lawful permanent residents but otherwise includes all foreign citizens and entities. The constitutionality of this law was challenged on First Amendment grounds but affirmed in Bluman v. Fed. Election Comm'n, 800 F. Supp. 2d 281 (written by Kavanaugh in his previous job), and upheld in a one-sentence affirmation by SCOTUS. So, 1st Amendment rights of foreign nationals are not protected to the same extent as those of US citizens.
It should be noted that the court also (expressly) did not decide if Congress could also constitutionally ban contributions by LPRs, or could prohibit foreign nationals from engaging in other forms of speech (issue advocacy and speaking on issues of public policy) – that matter was left undecided.
United States v. Verdugo-Urquidez, 494 US 259 (1990), holding that the Fourth Amendment does not "appl[y] to the search and seizure by United States agents of property that is owned by a nonresident alien and located in a foreign country," may have shed some light on this issue (while by no means this is conclusive on the issue of First Amendment protection over foreigners):
... While this textual exegesis is by no means conclusive, it suggests that "the people" protected by the Fourth Amendment, and by the First and Second Amendments, and to whom rights and powers are reserved in the Ninth and Tenth Amendments, refers to a class of persons who are part of a national community or who have otherwise developed sufficient connection with this country to be considered part of that community....
The question is very simple:
It is short, but not simple. Often short, seemingly simple questions have the most complex answers. The First Amendment itself has only 45 words governing six separate rights.
Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.
But, there are many book length treatments and thousands of precedents interpreting it. The combined First Amendment sections of my law school textbooks, which did not purport to be comprehensive, even though they spanned multiple classes, had more than 500 pages.
does the free speech protection provided by the First Amendment apply to non US citizens
Generally speaking, yes. Certainly, non-U.S. citizens are not categorically denied any protections of the First Amendment.
But, First Amendment protections are not absolute in any case (e.g. common law fraud, bribes, and genuine threats are not protected).
There aren't many circumstances when citizenship would be relevant to whether an exception to First Amendment protections under some sort of scrutiny or balancing test. But there are definitely some. The First Amendment does not extend, for example, to a right to have full participation in the electoral process which is governed by other constitutional considerations that are more specific. The answer by @user6726 notes some exceptions of this type.
The distinctions drawn are not, however, ones that can be derived with pure logic from the text of the U.S. Constitution. If a majority of justices of the U.S. Supreme Court say that it is constitutional to have a limitation on a certain kind of speech by non-citizens, that becomes binding national precedent which only the U.S. Supreme Court can question. Sometimes fluke exceptions arise because they became binding precedents before a more general rule was formulated and the relevant precedents haven't been overruled.
Usually, when a non-citizen's First Amendment rights are limited in a way that a U.S. citizens' rights would not be, that limitation must be grounded in some other constitutional consideration that has a citizenship dimension to it (e.g. rights arising under the privileges and immunities clause, of which there are not many, such as the right to apply to be a member of the legal profession in a state where you do not reside on equal footing with state residents).
does it apply anywhere, outside US territory, protecting these people as strongly as US citizens on US territory from US laws restricting speech?
The First Amendment is a limitation on the federal government (including the laws of D.C., Puerto Rico and U.S. territories) and by virtue of the incorporation doctrine and the 14th Amendment, upon state and local governments. Usually, this "state action" (more clearly stated "governmental action") by the federal government or a state or local government, will provide sufficient nexus to satisfy United States v. Verdugo-Urquidez, 494 US 259 (1990).
For example, a law criminalizing, in general, truthful reputation harming statements about U.S. public officials outside the territory of the U.S. by people who are not U.S. citizens or U.S. nationals (possibly also authorizing the arrest of people for that crime in defiance of extradition treaties in force, would almost surely be unconstitutional).
But, a law restricting the free speech of non-U.S. citizens in military detention or foreign territory occupied by U.S. troops pursuant to an authorization for use of military force intended to maintain peace, order and good discipline among these non-U.S. citizens for legitimate military reasons might pass muster, because some constitutional rights are subordinate to military necessity (although not the free exercise clause of the First Amendment).
But, the First Amendment does not limit what foreign governments can do or protect people from the actions of foreign governments (so long as the federal government, or a state or local government, is not conspiring with or soliciting a foreign government to do something that it would not be constitution for it to do itself).