In the same vein as this question and this question, I recently ran into a problem in my C++/SDL2 game architecture where I needed to get the R,G,B values from a clicked pixel in an image on the screen. That is, if the user clicked on a given image surface (SDL_Surface) or texture (SDL_Texture), it would give you back the R,G,B values of the specific pixel in the image that you clicked. The specific use case was for a color picker, to allow users to customize UI elements with a clickable color palette.
This resulted in many hours of keyboard-bashing, because it turns out that SDL2 really, really is not built to have simple solutions to such problems when it comes to shaders and graphics architecture (and that's completely fine - it comes with the efficiency of the library).
Therefore, to save future game developers using C++/SDL2 the massive headache I had to endure, I'm posting the method I discovered below as a self-answer to this question. Hopefully it's helpful to someone with a similar problem in the future!