This is more a discussion than an issue... I wonder on how to shrink the library further.
One feature is calculation of the required size, pm_expsize. Arguably, it is not very elegant: it complicates the code.
What if, instead, just the worst-case space is calculated? That is, eg. 4 bytes per regex character. (This would need to be verified.)