I can rewrite this to do individual inserts, but would like to find out whether there's a better workaround/idiom for this.
If you are going to use an INSERT statement, then your usage is a prime candidate to use prepared statements with. Your insert statement is parsed once and then the actual data insert is relatively little work and performs quickly. I believe this sort of activity is what happens to implement the you wanted anyway. -- Darren Duncan