You also need to look into diffraction on the sensor when you close down the aperture too much.
I looked up your sensor and it has a pixel pitch of 4.38µm, which computes out to a minimum aperture, without diffraction, of f/5. But, since this is too limiting in a lot of cases, f/10 is an ideal compromise.
Here is a series of shots at different apertures…
f/5
f/8
f/11
f/16
f/22
f/32
See how the glare from the strings increases as the aperture gets smaller, while the label in the guitar gets clearer.
As I said, sharpness comes primarily with adjusting the camera correctly, not in post processing.