Yes during the down swing the weight does shift forwards onto the leading foot, but that’s only a 2 dimensional movement! The majority of the weight in the golf swing actually moves down! In fact the latest stat on tour states that the average player forces 150% of his body weight down through the floor! So 100kg player would force 150kg of pressure down through the floor!
So legs need to be there for stability not for ‘driving’.
How should they work then? Well the answer is that they don’t really. During the golf swing the right foot (for a right handed golfer) will get pulled off the floor by the hips. The hips in the golf swing are the real driving force as they slide, turn and raise towards the target. It is this movement that pulls the trailing leg off the floor. So the trailing leg will actually finish fully extended (basically straight)
So leave your legs out of the shot and gain power, consistency and stability.