(This simplification is driven by some other early environment changes I would like to make)
Some complexity exists in these bits that isn't needed. The sysctl handler, upon change to '2', runs through the current set of hints and sets them in the kenv.
However, this isn't at all necessary if we're pulling hints from the kenv, static or dynamic, as the former will get added to the latter in init_dynamic_kenv [https://svnweb.freebsd.org/base/head/sys/kern/kern_environment.c?view=markup#l271]. We can reduce this configuration to just adding static_hints to the kenv if we were previously using them.
The changes in res_find are minimal, and based on the observation that once use_kenv gets set to '1' it will never be reset to 0, and it gets set to 1 as soon as we hit fallback mode. Later work will refactor res_find a little bit and eliminate this now-local, because it's become clear that there's some funkiness revolving around use_kenv=1 and it being used to imply that we're certainly looking at the dynamic_kenv.