Reopened as, though the initial issue is invalid, the current solution, as it is, is problematic.
The sample_color paint operator S has a problem with discoverability and is separate from both the general UI color picker and the sample tool. This needs a better design solution.
Old Description (resolved by sample_color operator)
Right now all color picking is using the display space, which usually makes it (almost) impossible to accurately pick colors from an image that is not sRGB for texture painting.
Similarly, for texture painting in the 3D viewport the picked color is that after shading and display transformation. This can be useful, but it should be optional. In a lot of cases the user wants to pick and draw a color from within the same image texture, without any additional color space conversion.
The View mode of the image editor already has a sample tool, which has the functionality to show the color data in image space without additional color management. So simply using this tool in paint mode for picking color with the option to select the color space would already be a huge benefit.
Further, having a similar tool for 3D texture painting would be even better, but I assume that this might have more difficult implications for the implementation. Tackling this for the image editor first using the Sample tool, might me a good trade-off for investing a small amount of work for maximum impact.