[3.8] bpo-16575: Add checks for unions passed by value to functions. (GH-16799) (GH-17016)

(cherry picked from commit 79d4ed102a5069c6cebaed2627cb1645637f0429)
5 files changed