Not a bad suggestion. Here’s a different point of view for consideration: avoid using pub.flow:clearPipeline. Instead, always explicitly drop vars as soon as they are no longer needed.
Here are some thoughts on this from posts many moons ago that may be informative:
(The last one refers to a notion of the pipeline being “copied over from services to services” but it is not – the pipeline is a global variable pool for the thread and all services run in that thread have access to the pipeline – with exceptions for services invoked as transformers or within a scope.)
Edit: A couple of the threads referenced above mention “best practices” – there is no such thing. Just practices that some find useful for their environment. You may find they work for you as well.