I am not a fan of stretching. When you stretch a muscle, what you are actually doing is creating little micro tears to the fibrous tissue and so the body rushes warm blood to the site of damage giving us the illusion of warming up. If you stretch beyond the muscle, you stretch the tendon and if you create micro tears to the tendons, since the tendon has no blood supply the body can't repair it but it can place scar tissue there. Scar tissue doesn't stretch and the next time you stretch the tendon, you'll tear the scar tissue. If you are lucky you will only get inflammation and median nerve entrapment (carpal tunnel syndrome). If you are unlucky you will develop sharp pains every time you move as every movement will be tearing scar tissue. Tendons are just rubber-bands designed to stretch and glide as a pulley system between muscle and bone. Flex a muscle = pull a tendon = move a bone. For every muscle there is an opposite muscle to pull the bone back. That is key, you can't move a bone in two directions at the same time. You can but something will break.
Instead of stretching, I would suggest finding ergonomic ways to make the arm place the fingers rather than the fingers dragging the arm behind it.
One of my teachers used to put hand lotion on her hands, then place her pinky and thumb on the front plate of they keyboard and press so there was no space between the thumb and first finger. Then she would to it with her ring, middle and index. She permanently damaged her thumb tendon and was never the same. As I said, tendons don't have a blood supply. That is also why torn ligaments or meniscus don't heal.
Unless you are a concert pianist who is willing to risk your career on being a slave to notation, I'd suggest making adaptations. I participate in a monthly organ recital on a tracker organ. Trackers are difficult to play if you don't know what you are doing. I played a Bach fugue and left out a middle voice because I didn't like they way it felt in my hands. This Juilliard grad was at my concert and ripped into me for leaving out a few of the voices. Several months later I went into the church and she was in there preparing for her concert and playing the same Bach fugue. She couldn't get through two bars without stopping. A tracker will expose every flaw in your technique. She wound up canceling her concert because she injured her hand. Karma. Do unto others. What goes around comes around.
Another problem with stretching is when you spread your fingers out you engage the abductor muscles. Then when you flex, you have those two muscles pulling one bone in two directions. This creates tension, maybe cramps and tears. It is a force vector.
I'd suggest you just enjoy what you do and that's that. Leave out what doesn't feel good. I'm sure the Weill Cornell Medical Center for the Performing Artist has a dozen musicians in their waiting room right now who wish that they either had more knowledgeable teachers to teach them to play ergonomically or didn't practice five hours of octaves or some such.