What would cause the black above the TPR on a electric water heater?
Can’t be good.
I agree I would look for a loose electric wire connection that could be arcing .
Did you look inside the top T-Stat cover?
I did not look under any cover.
If it’s really humid where you live that could be a likely reason, especially with it being a hot water heater it would be easier for it to rust or stain with water or humidity so nearby.
Someone torched a new nipple in place…Just a guess.
That is funny !