Have lingering pain in my penis from a prolonged masturbation session two weeks ago. Nothing visibly wrong, but a burning discomfort through the shaft and glans, even when flaccid. Erections have been painful.?

Things to consider. Pain is the bodies great signal that something is amiss. In this case you seem to understand the origin for your discomfort. The body is very forgiving in many ways and may self heal over time, even taking several weeks to do so. You may want to consult with a urologist to see if there is any evidance of long term harm and or ways to speed recovery.
Penis pain. You may have an infection. Please see your doctor. Peace and good health.