In BL_Shader::Update, KX_BlenderMaterial::setShaderData, KX_BlenderMaterial::Activate and KX_BlenderMaterial::UsesLighting that method is used. Mostly to check if the shader is OK and can be used.
So if you set that parameter to 0, it gets evaluated to False, Shader::Ok returns False when called and you probably shouldn’t see the shader working.
It’s a simple switch if the shader should actually be used or not.
I will check this with a bit more detail as the outcome is a bit strange. And the parameter makes no real sense. Who would set shaders without applying them. “apply” is not really something that tells what it does. So we need the hard way -> deep investigation.
…[edit]
it looks like a dirty hack (which explains the missing documentation):
It sets the shader for OpenGL, but then it tells the bge not to use it. This is strange.
setAttrib() ignores mOk at all and sets the shader too. I do not know what this call is used for. The doc says it sets an attribute location value. What is an “attribute location value” and why does this code set the shader (again)?
SetProg() (Non-python) sets the shader too, but cares the mOk flag.