The test p2p_private_broadcast.py gets some Python P2P nodes to listen and instructs the SOCKS5 proxy to redirect connections to them instead of to the requested addresses. This way the bitcoind which uses the proxy is tricked to think it has connected to real routable internet IP addresses or .onion addresses.
Picking the ports where to Python P2P nodes to listen however is tricky to be done in a non-conflicting way, given that other tests may run in parallel. #34186 made it possible to let the OS select a free port, so use that in
p2p_private_broadcast.py.
Suggested in #29415 (review)