Do glGet__() functions always modify their argument even on error?

Do glGet___() functions always modify the output variable, even on errors?

Examples:
glGetVertexAttrib, glGetInteger, glGetProgram, glGetVertexAttrib, glGetBufferParameter, etc.

Yes, this is an extremely minor optimization that is fairly unsafe and probably shouldn’t be done. Since this question is implementation dependent, I’m looking at OpenGL 3.x and 4.x.

Yes, this is an extremely minor optimization that is fairly unsafe and probably shouldn’t be done.

What is a “minor optimization”? What are you “optimizing”? And most important of all, if even you believe that it “probably shouldn’t be done”… why are you doing it? Whatever it is that you’re doing.

Since this question is implementation dependent

You asked a question that you already knew the answer to (though technically, the answer is that it is undefined in most cases, not implementation dependent). So… what exactly do you want to know? The answer is what you said: there is no answer.

Answered my own question:

glGetQueryObject

If an error is generated, no change is made to the contents of params.

… how does that answer your question? That answers it for one function, but not for all of the ones you asked about.