The OCaml 5.0 includes Domain.recommended_domain_count which seems to be a reasonable default value for Task.setup_pool. Making the argument optional is code-compatible with existing code.
This would also create a mechanism within Task to use Domain.recommended_domain_count without incurring the "unstable" alert on the Domain module.