OpenGL uses a pipeline architecture, this means that your graphics don’t use any memory (except of course for the frame buffer) and you can disable the Z-buffer.
So you can just use the 2D version of the glVertex calls (glVertex2xxx).
Why disable the Z-buffer when you don’t even have to enable it in the first place, it’s disable by default. And if you don’t want a Z-buffer at all, then don’t ask for one when creating the context.
After all, 2D is just a special case of 3D. It’s 3D where all coordinates has the same Z-value.