Perl_newHVhv() should copy immortal values as-is, such as PL_sv_undef
Currently it calls newSVsv() always, which copies the value, but the immortal
SVs are used as much for their addresses as their values. You can't get the
immortals into HVs from Perl-space, except for PL_sv_placeholder, and any hash
with those will take the else block, where the call to Perl_hv_iternext_flags()
won't be returning placeholders anyway. Hence If XS code has gone to the
trouble to get the "impossible" in there, they had a reason for it.
I am assuming that Perl_hv_copy_hints_hv() should stay as-is, as it is
documented that only strings and integers are supported values for %^H.