My dd has had threadworms several times, and each time I was either pregnant or breastfeeding and was not allowed to take the medication. There is a medication that I could have taken, but the GP prefered me only to take it if I had to, ie if I got the infestation.
The rest of the family ddi take the mediation, and we were all scrupulous about hand hygiene for several weeks. We kept nailbrushes by every sink and basin, and taught the dc to use them.
You're told to wash bedding and clean everyting, but I'm not convinced it's worthwhile, as the eggs are so fine they can float in the air like dust-motes.
Whenever we discovered an infestation, dh would strip dd's bedding and launder it, to minimise the risk of me inhaling eggs. But apart from that, we didn't do anything different regarding household cleaning.
The very first time dd got threadworms, before we learned the signs, it was several weeks until I took her to the GP, and dh thinks he may have been infected in that time. But appart from that time, nobody else in the family has cuaght it from her (or at all, for that matter).