Great question — answering as the UphillTech team:
You can use a special in-wall splice called a tyco or NM splice and add enough to move the receptacle over. These splices are not required to be accessible and are kind of expensive, but they do what you want and are available at big box and specialty stores.
Full answer by Ed Beal: https://diy.stackexchange.com/a/191920 (CC BY-SA 4.0).
Need it done for your business? UphillTech.