Using, e.g., the Bitcoin Core command line, how could I spend bitcoins from multiple wallets in a single transaction?
This comment says:
instead of sending the transaction to the network, you send it to the next person who will add their inputs and outputs and sign them as well, and so on. The last person would then broadcast the transaction on the network.
cf. Mastering Bitcoin (1st ed.), §"Using Bitcoin Core’s JSON-RPC API from the Command Line", §§"Creating, Signing, and Submitting Transactions Based on Unspent Outputs"