That's exactly what I'm talking about. But you've indicated in your private message that you don't want to destroy any controller and want a solution that converts a signal directly. That requires a box.
A PIC is a programmable integrated circuit. Not quite a full microprocessor, it has basic writable ROM and instruction capabilities. You would have to program one to accept the serial signal from an N64 controller. Then you would have to program it to produce output that the NES or SNES can interpret, in the same way that the encoder chip in the real NES controller does.
Then, you wire a female N64 controller port to the input of the PIC. This will allow you to plug in the N64 controller directly. Then you wire a male NES or SNES controller cable to the output of the PIC. This will allow you plug the device directly into an NES or SNES without having to destroy an existing Nintendo controller.
Remember that the serial signals used by the N64 and the S/NES consoles are not compliant with the RS232 standard. That means you can't just Google the term 'serial signal' and expect to find results on how to program the thing. You'll need detailed instructions and white papers on the decoder and encoder ICs used in each game console.
Again, programming is off-topic for GamesX. Composing the assembly code that goes into the PIC is left as an exercise for you. Put another way, I won't write it for you.