9005 LEDs will fit your 17' optima no problem. When I got my optima I noticed the headlights were trash as well, so I swapped them out for some HIKARI (2020) 9005 bulbs from amazon for about $70 in my low and high beams, and they worked like a charm (just make sure you align them at the 9 and 3 o'clock position). Swapping them out to LEDs was better over the stock halogens, just not as good as the stock LEDs in the top trim (as for some reason these optima's have an odd low cutoff, but I believe you can manually adjust it).
Definitely agree with the HIKARI 9005 LED headlamps found on Amazon. I've been using them on my 2017 Optima LX 2.4 for a year with no problems whatsoever. I use them in both low and high beams, single projector housing. Very nice light color (like high-end OEM LEDs) and built-in fans are quiet.
As OptimaSOwner says, orient them correctly when putting into the socket. Once they're in, adjust the cutoff by using the dials on the back of the headlamp cases so they aren't pointed up, blinding oncoming traffic.