I can't really believe that this hasn't been done yet, but a mod that adds 2B as a fully functional companion.
The biggest problem is that it's un-immersive, but there is an easy solution to this.
around the events of the game, the Institute starting beta testing of a gen 4 synth (and they were all big Nier automata fans, so naturally they made 2B). When x6-88 becomes available as a companion, the institute gives you a second option of assisting in the beta testing of the gen 4 synth. This might be the most emotional synth ever produced, providing an interesting character arc (going from mechanical and machine like, to human).
This back story could have many other elements that would just be neat; perhaps every once in a while, 2B could totally malfunction (maybe glitch and stop fighting, maybe say verbal error messages in a deep gruff voice, maybe comedically misunderstand some things the sole survivor says); there could be a retro style Nier Automata game in all the terminals in the Institute.