What is this and why would it be there?

Was it running and being used like that ? Was there water in the oil ? If not and it’s not a high dollar build leave it alone.
Maybe it was “pinned” or welded and the epoxy was just for extra insurance.