Enforce a maximum string length.

Also cleans up 64-bit size mismatches.
Fix Linux build caused by cb59a7133f4c8721fd24263f6e165a7b6892ada3

argv is used by the Linux build; mark it as unused only on Win32.
Clean up conversions.