While playing with ??? and around The Depths, I noticed that I was doing really well. I was getting hit by anything, so I began thinking, "No way I could be doing this good, something must be wrong." Sure enoug, when I got to the first battle with Mom, I just stood there and let here stomp on me to see what happened, and sure enough, I took no damage. After testing further, nothing in the game could damage me, not even my own bombs.
I can't say for sure how this happened, but it likely had to do with the combination of items that I had. I noticed it shortly after I acquired the Halo of Flies, and since the flies occasionally protect you from damage, I'm guessing the game glitched up and gave me permanent protection. In addition to the Halo of Flies, I had, Poison Touch, The Horse, the Spelunker Hat, and a few range and tear buffs that probably weren't a factor.
In a game like this, it would be really difficult to try and re-create the glitch, so it might be pretty hard to figure out the cause.