I am no lawyer, but there was a lot of discussion of the subject in the Gulf boating newspaper during the years I was there, which was until 2004, and I doubt it has changed since then.
US law has no provision against travel to any other country. But boaters who went there were charged on their return with breaking the embargo, on the grounds that they had spent US dollars in Cuba. There was even one race to Havana from Florida where the organisers got legal advice that they should be OK, but customs walked up and down the dock, just before the boats set sail, handing out notices that there would be dire consequences for any sailors who participated. Several were charged with offences when they got back, which they could not afford to defend. It was highly controversial, and had never been tested in court - there was talk that such a restriction violated constitutional rights, but any such decision would be taken by the government to the supreme court, and no boaters had the money for that kind of campaign.
Morgan may be able to add more, he only went there after receiving special permission as a journalist (the trip is a great story when he tells it).
For a Canadian, I have read that there are no restrictions on travel to Cuba, thanks to successfully fighting off the yahoos from the south in 1812. But the US registered boat could cause a problem, I have never heard of that kind of situation before, and I dare say it has ever been tested in court either. You would likely face harrassment if you pulled into a US port after leaving Havana, as, based on the reports in the boating newspaper, customs patrol looking for boats on that path. While you could try telling them to go #$%@ themselves while waiving a Canadian passport, that would just lead to more harrassment - after my experience crossing the border at Niagara Falls a few months ago, customs agents in both countries can have some major issues with ego control.
So what would I do if I were Canadian? Go to Cuba. Ask them not to stamp your passport, I have been told they will understand and be helpful (any idea Morgan?....) Go directly from there to the Bahamas, and if you are intercepted by US patrols on the way, tell them you are a Canadian operating in international waters and outside their jurisdiction, which would be well within your rights under international law. (As a navy man, that is standard procedure with the Iranians, but it helps to have a couple of Gatling guns pointed at them.) Sailing into a US port on your return from the Bahamas, you would be off the stretches of patrolled water. If you have a Cuban stamp in a Canadian passport, it would not be a problem, but in a US registered boat, I would go into a port north of Florida where the authorities would be less conditioned on the Cuba issue, and hope for the best. Again, I doubt you would have broken any law, but that would not stop certain people, being paid our tax dollars, from making your life hard.
The above advice is worth exactly what you paid for it.
Gareth
Freyja E35 #241 1972