I've kept Euphorbia around for about 40 years. It grows in all but one of my gardens and I have no moles, rabbits or anything else bothering the plants. On the other hand, I have one side area which is close to a neighboring house, so I never planted Euphorbia on that side. That garden contains my shade plants.
It has more mole/vole tunnels than I care to mention and has been the most difficult area to maintain because of critters.
It's the sap in Euphorbia that's most toxic, so animals stay away from it.
Like with a lot of other toxic plants, use caution particularly when young children are around. The sap is likely to be a skin irritant as well, so again, use caution when planting or weeding.
It can be invasive, spreads by long runners. Pretty foliage and blooms, though.