Speaking as another divorced mother (remarried now), you can't control what your ex does, even though this could be a life or death situation. A court order won't force him to be vigilant. This would drive me insane with worry!! (I had a different thing to drive me insane with worry: drunk driving.....a court order won't actually prevent that, either.)
Get her in swim lessons asap, the kind that teaches survival first, not true swim strokes. For example, they will teach her to turn around and find the side of the pool if she falls in, instead of flailing and ending up further into the middle of the pool. Practice, practice, practice in your pool, until it's second nature to her.
If you find some floaties she loves, she might insist upon wearing them herself, for some added protection. My daughter had some that looked like fairy wings.
I pulled my daughter out of the pool at age four, when she accidentally fell in (in her swimsuit, playing near the pool). Because it was unexpected, it startled her, and she forgot what to do. If I hadn't been watching her closely, it would have been tragic. When lots of people are around, it can be more dangerous, because people think everyone else is watching. If your ex truly concentrates on watching her, she'll be okay. But if he doesn't, then do all that you can to help her handle herself.