sharing common functionality for template functions when the template changes a small portion

My project has a couple of awkward locations with respect to templates. I understand that my usage is slightly non-standard, but the awkwardness as fundamental benefits (primarily, unrolling a bunch of loops). AKA please do not respond with "oh you shouldn't be using templates". The awkwardness involved has empirically been shown to have over a 10x speedup...