This does not appear to be well standardized at present. The best Mythryl-level solution currently appears to be to do
core_count = posixlib::sysconf "NPROCESSORS_ONLN";
(The complete list of values available via sysconf on your system may be found in src/c/lib/posix-process-environment/ml_sysconf.h which is synthesized at build time by src/c/config/generate-posix-names.sh from (typically) /usr/include/unistd.h.)