Hi Glenn,
The way I'd tackle the issue of compilation of shaders taking a long time is to avoid doing it frame time, doing as much work in scene graph setup/compilation.
For you usage case I assume you have a complex shader with many different constant inputs either controlling code paths or values, and the scene graph is configuring these as the values change provided by the scene graph via the #PCS defines. If you can work out what range of different defines you will need then build a subgraph with each of these combinations and the sharing osg::Program that depends upon these then compile this subgraph, once it's all compiled you can discard it save for the osg::Program that you then reuse in your main application.
This approach should in theory populate the osg::Program with all the GLSL program combinations that you will need and the OSG can internally just use these when rendering your main scene graph.
Robert.