In lieu of me being sufficiently non-lazy to document hair color data:
Edit byte 0x14031 in a CG save (0x19431 otherwise) to "02".
This'll set your hat index to "2", making you hatless.
It'll also change your hair color in addition to ridding you of your hat (the upper bits are data for hair color in that byte), but I don't want to document how that works right now, so this is a guaranteed way to do it. (You can change your hair color in-game to what you want it to be afterwards.)
Edit byte 0x14031 in a CG save (0x19431 otherwise) to "02".
This'll set your hat index to "2", making you hatless.
It'll also change your hair color in addition to ridding you of your hat (the upper bits are data for hair color in that byte), but I don't want to document how that works right now, so this is a guaranteed way to do it. (You can change your hair color in-game to what you want it to be afterwards.)