Here is how to avoid a game over in Luigi’s Mansion 64!
After unlocking the upstairs door of the castle, go to the stairs leading to where the star door is, above the small door leading to the upstairs area (which is now a 90-star door instead of 50). If you don’t have 90 stars, walk onto the stairs and then do a backward long jump (BLJ) by holding the keyboard down and then back up while mashing the Z button and shift if you’re in Mupen64Plus. When Luigi gets to the wall next to the door, repeatedly press Z and shift again when Luigi lands. Eventually, you will go right through the wall next to the door if done right.
Regardless of whether you did this glitch or not, what you have to do next is go into either the hole where Wing Mario Over the Rainbow was or the hole where Rainbow Ride was. Both of these holes will warp you to the castle grounds where you will lose a life. I recommend doing this when you’re already at 0 lives so you only have to do it once, especially if you had to do the BLJ. After 0 lives, your live count will show up as M1, which means negative 1. Now, every time you die, your lives will go down to M2, M3, etc. They will continue to double digits (M10, M11, etc.) so you won’t get a game over. Enjoy this fun glitch that will make the game more fun because you won’t have to face that game over screen until you close the emulator!
By the way, this glitch makes 1-ups poisonous. Each one takes away one of your negative lives until it reaches 0 again. So if you decide to do this, don't grab any 1-ups so you can show off all your negative lives!