TSS is a risk with anything foreign being inserted into your body. It’s caused by Staphylococcus aureus, a common bacteria found in our skin. The risk increases based on the object inserted, the texture, the duration and how frequently it’s inserted. For example, lower absorbency tampons have lower risks for TSS vs higher absorbency tampons. For anal, TSS is much rarer, generally associated with tissue tears and injury due to long term use of toys. This can be mitigated through proper cleaning of toys as well as limiting insertion to a few hours at most.
In my experience, the main cause of TSS is tampons that have been forgotten and left inserted for days to weeks. The only way to completely absolve the risk is to never insert anything vaginally or anally but realistically, if proper toy cleaning and hygiene are used, this risk is very small. Naturally, I would not recommend long-term use of sex toys. Keep in mind this is a rare complication (1 in 100,000 people per year in US) and is not always associated with vaginal/anal insertion with surgical wound infections, skin infections and secondary infections related to recent viral illness making up approximately 50% of the cases.
Best practice: use your common sense. TSS is very scary but it’s rare and unlikely to happen through casual and safe use of sex toys.
Disclaimer: I am not a doctor, I just know a lot about microbiology/immunology.