Yes, any compliant USB-C Male to USB-C Male cable should work. So if you get a shorter cable, that should be fine. Since you have no way of knowing whether a cable is compliant, I guess you are looking for a reputable / known brand from a reputable / known seller. But that can be a difficult ask for cheap, commodity items.
The shortest I find from my regular supplier is 20cm.
As far as the stiffness of the cable goes, I would recommend just keeping the cable dead straight, particularly if you are getting a shorter cable.
I’m using the Purism-supplied cable in the house for charging but just some rando cable with the car charger in the car and I haven’t had problems charging in the car.
Since USB-C is by definition both data and charging … when I connect the Librem 5 to my computer (so data becomes important and charging basically irrelevant), again, I am just using some different rando cable and I haven’t had problems.
PS: When I connect the Librem 5 to my lapdock, using the cable that came with the lapdock (data is critical and power flow is important), that is a much shorter cable than the Purism-supplied cable and I haven’t had problems.
So, in summary, you would have to be unlucky to choose a cable that does not work.
I think it’s supposed to work because there is supposed to be a negotiation between the charger and the phone, like the charger says “I’m a charger and I can deliver power in the range x to z” and the phone says “I’m a device that wants to charge so and so much”, and then they are supposed to agree on how much power the charger should deliver. The case when it would not work would be when the charger is too weak so it cannot deliver even the minimum required by the L5. That’s how I think it is anyway, I could be wrong.
Okay, what if we put it this way: a random charger should work, there’s at least a decent chance that it will work, and only a small risk that the charger would be so buggy and/or evil that it would damage your L5 phone?
If it’s so bad that it will damage the phone then it will damage all sorts of other things too and its place is in a landfill.
Usually the failure mode is not “damaging things” but rather “being unable to actually provide what it agreed to” (sometimes due to a damaged cable) or “stuck in an endless loop of renegotiation cycles”, and both can cause troubles with charging. IME it’s rare, but it happens.
Another class of failure mode is that the power source has a USB-C connector but is not designed as a general power source.
For example, I have a dehumidifier that contains moisture-absorbing beads. When the beads have absorbed too much moisture you have to regenerate the beads using the supplied power source. The basic purpose of the power source is to generate heat within the dehumidifier and it should, in my opinion, be considered dedicated to that one purpose. I would most certainly not use that power source to charge a battery. It may be USB compliant for some version. Or it may not be. It’s not something that I would want to risk with expensive electronics.