Bind to an ephemeral port, force it into the TIME_WAIT state, and unbind it.
conda install conda-forge::ephemeral-port-reserve