PHPC-1378 presents a case where PHP platform information is getting cut off due to user-specified CFLAGS and LDFLAGS taking precedence in the handshake document (limited to 512 bytes). While PHP could avoid setting these constants in its own build configuration, that wouldn't apply to deployments where libmongoc is used as a system library. I would like to propose deferring CFLAG/LDFLAG appending until after the wrapping driver's own platform info.
This would require some reordering of the handshake construction, given that the platform string is first initialized during _mongoc_handshake_init, which is likely before a wrapping driver would have a chance to call mongoc_handshake_data_append.
Note: "posix", "stdc", and compiler info are also appended to the platform string before a wrapping driver's data; however, I'm not too concerned with those fields as their values should be short (unlike CFLAGS and LDFLAGS, which can easily exceed a handshake's size limit).