I figured it might be. That's why I saved *before* entering the cheat code. But after I had a good laugh I went back to my saved game and he still turned into the twi'kek even though I didn't re-enter the code.
Dunno why it happened this way for your saved game.. but when i tried to retrieve an earlier save game (not for malak final battle, but for pod racing) it turns out okay for me without any residual cheats.
I could suggest editing the file & deleting the line that says enabling cheat mode = 1 or something like that.