Part of #43927. Pylance gives a number of warnings for variables that might be unbound. They can't really be unbound, as far as I can tell, but clean them up anyway.
array_size_u in Field.get_put_real(): Probably best to define fallback error values in the branches where it isn't currently defined
delta_header2 in Variant.get_send(): Move the use up to the spot where it's actually needed
v in the code to generate the else-branches in get_packet_handlers_fill_capability(): Use the Packet instead of the Variant
Part of #43927. Pylance gives a number of warnings for variables that might be unbound. They can't really be unbound, as far as I can tell, but clean them up anyway.