to_flags is currently a 64-bit integer; however, we only use 7 bits. Furthermore, there is no reason this needs to be a 64-bit integer for the foreseeable future.
Also, rS195654 introduced a permanent inconsistency between the to_flags value in struct tcpopt and the mask in tcp_addoptions(). Before rS195654, to_flags was u_long and the mask in tcp_addoptions() was u_int. This meant that both were 32-bit values on platforms with 32-bit longs, but could diverge otherwise. rS195654 changed to_flags to be a u_int_64t, meaning that these variables would have different lengths on platforms without a 64-bit integer.
It seems to be a "win" to convert both to_flags and the mask in tcp_addoptions() to be 32-bit variables. This should save a few cycles on 32-bit platforms, and avoids any problems/questions caused by mixing variables of different types unnecessarily.
(Converting optlen to a u_int_32t should be a no-op, but I can leave it as a u_int if anyone cares.)