Is a constant condition more costly than switching shaders?
On modern hardware if all invocations in a group follow the same path then the unused path doesn't get evaluated.

in pseudo code:

if(cond){
   res = ...
}else{
   res = ...
}


becomes

if(anyInvocationARB(cond)){
    res1 = ...
}
if(anyInvocationARB(!cond)){
    res2 = ...
}
res = cond?res1:res2;


Where anyInvocationARB will be true if any invocation of the shader will have true as cond (from the opengl extension ARB_shader_group_vote). 

If cond is derivable from uniforms alone then the driver may optimize and evaluate the condition before starting the render and replace the if with a goto to the correct branch. OpenGL has a feature called uniform subroutines that makes it explicit.