US law applies to anyone departing from a US port/airport.
However, the US government has not been checking up for years and years on exactly what US travelers have been doing in Cuba, less so on those from other countries. Usually no questions are asked on return; maybe about cigars and rum brought back, if that.
Look at the definition of the "support for Cuban people" category in particular.
1/iii here:
https://www.law.cornell.edu/cfr/text/31/515.574
Relax. Enjoy Cuba.