Yes it is very dangerous. Reach Throw Row Go
That is what we were taught in Scouts.
First, from the shore, try to reach out to the person, or grab a towel and try to get one end of that to them, pull them to shore.
That doesn't work, throw a life preserver.
Third, if you are at the beach, get in the boat and row out.
Only in the last measure, swim out.

However in this case, if it is a 4 foot deep pool, I would have waded out and manhandled them, I am 6-3 and pretty strong.