Don't believe random advice people give you in the gym. Do your own research to verify.
You want to exercise full range of motion, at least some of the time, to improve strength in those end ROM positions (eg lockout).
I agree, but this wasn't necessarily random advice, however, it's also not exactly about lifting weights.
Technically it seems holding 25kg in each hand hanging vertical would exert the same force on each shoulder regardless if elbows are bent or not, but common sense, years of going to the gym, and this thread, it makes sense that it causes other muscles to change the direction of forces.
Now if the arm was replaced with two pieces of metal, connected by a hinge for an elbow, and a ball/socket for the shoulder, things should be different. If the hinge could be tightened so it's being bent at a 45 degree bend, the ball/socket would rotate so the weight is still perpendicular to the ground, however, now force would need to be calculated on the hinge and the ball/socket. Unless I'm thinking about this wrong, the same force would be on both the hinge and ball/socket.
In this example, it would be 25kg * 9.8 (rounding up to 10) 250N on the hinge (i.e. elbow) but at 125N on the bottom piece of metal and 125N on the upper piece of metal, and then another 250N on the shoulder; but it wouldn't have any angles because it's just rotating on a ball and the downward force would be the full 250N.
I think in the case of a human, the back muscles and would pull on the arm muscles thus relieving some of the force on the shoulders. Same with the elbow, the bicept/tricept would pull on the forearm thus relieving stress on the elbow.
Maybe I'm reiterating everything said here, but believe this is the most common and simple explanation.