This is not a limitation of bitcoind, but of the shell.
The solution would be to make a small Python script that passes the transactions to the RPC API (for example, from stdin) instead of relying on the command line.
A-ha! Thanks!
Actually I now found out it's a kernel limitation, not bash one.
Anyway, for anyone else with the same problem finding this by chance: very simple scripts that do just what John Smith suggested are here on wiki
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)