SERVER-64797, we converted our usages of timestamp_transaction to timestamp_transaction_uint. However, for instances where we use commit_transaction (for example on secondaries), we're still serializing the timestamps into a string. We should try to avoid the serialization for this case as well.
One option is to call timestamp_transaction_uint twice before commit_transaction, something like:
A potential downside is that there may be some extra overhead from this approach, since the timestamps will be validated twice: once when set and once when committing.
Another option is to look into adding a new interface from the WT side for this purpose.