Avoiding type instabilities (with StaticKernels)

I ended up brute forcing my solution, which is to use code generation to create lots of different Kernel objects having window sizes in the range I’m looking for and functions that I might want to apply and declared them to be const. Not quite what I would prefer, but well worth the effort in terms of performance.