OpenSSL has X509_VERIFY_PARAM_set_hostflags() to set hostname verification flags like X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS. But there is no X509_VERIFY_PARAM_get_hostflags to fetch the flags from an X509_VERIFY_PARAM*.
(Also X509_VERIFY_PARAM_set_hostflags() doesn't behave X509_VERIFY_PARAM_set_flags() / X509_VERIFY_PARAM_clear_flags(), but it's probably too late to change that.)