Package code should let the user control the number of cores to use.
There exist several mechanisms to specify the number of CPU threads to use for parallel operations (e.g., option Ncpus) one of which should be used when determining the default numCoresToUse.
See also https://parallelly.futureverse.org/#availablecores-vs-paralleldetectcores.