Could a slightly bent rear mech cable be the cause of poor shifting?
No, the 'bent cable' is not causing the problem.

As soon as the shifter pulls the cable the tension of the derailleur springs will straighten it out. It may be slightly bent when first installed but should straighten out in a short time.

The excessive slack you have in that cable indicates something is adjusted incorrectly. Presumably the derailleur is on the smallest sprocket and is resting on the high limit rather than being controlled by the cable and shifter. That would mean your indexing adjustment is off. I'd work through a rear derailleur setup process to fix that problem first. The Park Tool Rear Derailleur article and video is has a very clear step by step process.

If that does not improve your indexing, the next thing to look at is the derailleur hanger alignment.