[py] Improve type hints with union syntax and native types (#16590) NOKEYCHECK=True GitOrigin-RevId: e19680e1a1c366ca35ab24088767f9a963fef8de