At the expense of the elbow, it should not be pressed against the body in order to hinder movement, but it should not stick out too much. He must be in a natural position. There is no perfect technique, just like the position of the elbow, there is a technique that is described as close to ideal, for example, Ma Long's topspin forehand, and your task is to try to adapt this technique to your body.
I don’t know if I understood your question correctly, but you don’t need to shorten your movement, while focusing on the position of the elbow, but on the contrary, you need to learn how to use your long arm as a flexible whip, for this you need to relax your arm and give it an impulse with your feet - hips - shoulders.
So here is how my Chinese coach taught me how to loop underspin with topspin growing up.
We agreed to start off with the ball falling down to be the timing where you loop the ball upward.
Then I started using my forearm (i.e. at the elbow) joint only. At that point, my elbow is literally attached to the side of my body. I was purely using my elbow joint and forearm to loop. By the way at that point, with tacky 729 friendship rubber, using only the forearm, I could loop slow spinny high loops that got me many points playing other junior players.
Once I mastered that, he asked me to add my waist to it.
After that he asked me to drop my shoulder and add my shoulder to the whole set of movements. In other words, start with the shoulder to initiate my arm movement, then move my forehand.
Then after that, he asked me to put weight on my right leg (I am right handed) and do a weight transfer while pushing off the ground.
Then he asked me to extend my elbow a bit further out of my body to really use my arm like a sling. That he showed me over and over again. Use it like a sling. Took me a while to get what he was talking about. It is about being totally relaxed before exploding your whole body and your whole arm to generate the power necessary for a loop attack.
The last two steps, which came together, was to hit the heavy backspin ball now at the top of the bounce and hit through the ball while brushing, and do ALL of the movements above. That last step really confused the heck out of me. Because he totally changed my timing and asked me to hit and brush at the same time? But what he was trying to do was to teach me a loop-drive. Meaning even if the ball coming at me with heavy backspin, I can still attack aggressively right off the bat and not try to play it safe and look to loop it back on the table "safely.' He wanted to attack aggressively even when facing a heavy backspin ball!
As you could tell, as a junior player, I was only playing once or at most twice a week (busy trying to get into university) so we had to progress slowly but we finally did it!
Now, my current coaches are saying that my elbow is too far out. The modern play is quick, fast (like how Chinese women play). My elbow being too far out of my body slows down my movement and makes my loop unnecessarily big, and impedes on my recovery time. One of my current coaches did tell me that he noticed my elbow was further out than he would like to but if I recover in time, he is not going to change that.
So how far your elbow goes out, you just need to figure out your comfort level. There is no one single right away to play table tennis.
Look at how Ma Long loops v.s. how Timo Boll loops. They loop quite differently.