The post itself isn't too bad because these are parsed at the time the post is made in addpost.php. For some reason I had to do the signature at the time the post is displayed, can't remember why. So, it's only the sigs that will make the extra db calls.
Yeah, if you could grab all the patterns at the beginning of showflat.php and stuff them into an array then make the array global to do_markup there should only be 1 extra db call needed no matter how many times do_markup in the individual processing of that script.