In my opinion, the general easiest way is what has been said above. Figure out a good distance(dependent on the move speed) and as soon as you would be about out, simply do an instant movement of your character from one place to another, and keep the other stats, like inputs, movement speed, etc... You don't have to do it when completely out, rather for example, if your character moves at 2 pixels a frame, then when your character only has 2-4 pixels left inside, that's the point where you switch to the other side, and the position on the other side could have 2-4 pixels of the character on the inside.
One other idea, if you are using any programming language that lets you create classes/objects, is to create a special object. You would make this object only do a couple things, move a few pixels in a certain direction, draw a certain sprite/animation, and then delete itself after a few frames. Now, the catch to this method is that you probably would need to have a certain commitment at a certain point. Maybe once the character is halfway out, you then commit it to follow through with the motion. At this point, you create your "dummy" and give it the sprite/frames of the character, along with the speed, etc... and at that point, you can move your real character to the other side. The point of having the dummy object is so that you don't have more than one instance of your actual character, so for example if your AI depends on that, you don't have to worry about accounting for that as you never duplicate the character. And the fake object would delete itself after however many frames you set it to, so you don't have to worry about managing it later either. The bad part about this method isn't so much the coding(as long as you understand OOP, or are using a framework that makes this easy, like GMStudio or Unity), but rather in the whole part about the commitment. If your players are used to being able to turn on a dime, then you may have to forgo the whole visual, but if movement is grid-based, or simply can work without instant friction, etc... than this version could work. And the techniques can work for other things, making you learn how to create and use different types of objects for things like this.