You could make use of shared library filters where you link against a native implementation. During installation you can then provide specialized implementations.