I’m pretty sure the software is the true limiter on the maximum capable performance. If you were somehow able to put a more powerful motor in there it likely wouldn’t do any good unless you also could modify the software to take advantage of the more powerful motor. As
@neptunesfinest mentioned above you would likely have greater success in just messing with the software to try and coax more power from the existing motor. You’re talking a LOT of time (and probably a lot money) to try and figure how to do what you are proposing which would result in a modified vehicle that I’m sure Tesla would refuse to provide service for. Doesn’t seem worth the trouble to me.