Either the Glock 17L or the 34 can be modified with a 3.5lbs trigger for competition/ target shooting. On the Glock website they both come with 4.5lbs trigger pulls which can lighten up a bit with extended use. If you’re going to target shoot only the 17L has the longer sight radius @ 8.07" the 34's 7.56" which could and should give you an advantage on paper. For IDPA you'll want to go with the 34 since it meets their length requirements. Either way they are both fine pistols that can be modified to suit your needs.
I got a 17 and a 34 . The 34 is considerably better suited for target shooting than the 17 . I don't know about the 17 L . I don't find my 34 to be a lot more accurate though . Both of mine are nice shooters .