"Does the GPU have an effect in music production?" I admit it's not a subject I know much about but I guess the CPU is the prime factor with musical notation in Logic Pro (or other DAWs), with the GPU playing a much less important 2nd role. I would be surprised if an upgraded gpu provided significant enhancement.
Having said that the question is not really relevant to the current 24" M1 iMac as to the best of my knowledge the Apple GPU is common across all three models. Obviously the situation could change with the announcement of the larger-screened M1 iMac later this year.
If I had to buy an iMac M1 24" today I certainly wouldn't entertain the base model due to the lamentable lack of ports, but opt for the intermediate model with 16Gb memory, and purchase additional external storage (i.e. Samsung T7) as imho the price of Apple 520GB memory is a rip-off.