Backport PR #54586 on branch 2.1.x (REF: Refactor conversion of na value)
Backport PR #54586: REF: Refactor conversion of na value
@phofl 
Does this need to be backported?

It says this is a pre-cursor for #54585, and that seems to be a pre-cursor for #54533 which will probably miss 2.1.

 No none of those should miss the release, lets merge this, it's only copy-paste things around anyway which is not user visible