Awhile back I wrote a wrapper for rb_thread_blocking_region

http://github.com/oldmoe/mysqlplus/blob/master/ext/mysql.c#L214

which allows for calling it like

 rb_thread_blocking_region_variable_params(10, &mysql_real_connect,
RUBY_UBF_IO, &myp->handler, h, u, p, d, pp, s, f)

instead of creating a custom struct per call.

This wouldn't work if you actually had to pass in params that aren't 4
bytes, I suppose, but if there's any interest I could roll a patch for
core.
Cheers!
-r