Export a function to build command strings and improve argument escaping.