I got told the same thing by my father a couple of weeks ago, and I'm pretty sure you're getting confused. In bullets, for the sake of brevity:

1.Sarsaparilla is a beverage, and made from the Sassafras root

2. It's not a carcinogen, and is readily available in health stores.

3. You're thinking of Safrole oil, which is massively different. Like many things in such a high concentration, it might be poisonous. Might be. Tea tree oil is toxic, yet we all know of the benefits of tea

4. Lots of spices contain Safrol, and have never been found to cause a problem.

Sarsparilla is made from Smilax regelii, aka Sarsparilla, though you are correct in that sassafras is frequently used in the U.S. to make root beers that are labelled as sarsparilla.

Safrole, a chemical found in sassafras root (among other things) may be carcinogenic to humans, and as a result, both sassafras and safrole were at one point (and may still be) banned for human consumption by the FDA.

You are both right and wrong. In the middle of the last century a study determined safrole to increase the risk of liver cancer after feeding them the equivalent of 32 bottles worth of sarsparilla soda. As a result, all commercially made root beers and teas had to switch from the natural root to another root or artificial flavors. A more modern study has shown a link between low doses of safrole and the self-destruction of certain cancer cells, namely oral cancer. And point number 4 is a good point. Many other spices contain safrole but have gained no attention of the FDA.

So the real answer is that, as with many thing, the FDA has no friggin clue what the actual long term effects are and if they are overall positive or negative. My opinion is that having a sarsparilla soda from time to time is probably completely safe and possibly helpful. But I am no doctor or scientist and is just my opinion.