In general a longer barrel makes for better accuracy.
For self defense you are dealing mostly within 21 feet. So the question is whether your gun is accurate withing the distance you plan to use it.
For example I have Sig P220's in 3.9 and 4.4 inch barrels. At 21 feet I don't notice any difference in accuracy but if I go out to 25 yards I think the longer barrel wins.
Each gun/manufacturer is different. I have a Taurus PT145 which is shorter than either Sig and it is also less accurate. This can be a function of barrel length and manufacturer design. I also have a NAA 32acp Guardian that ain't accurate beyond 9 feet.
So how you plan to use it determines what you get. If you are planning to be match-shooting a longer barrel is better but for self defense 3.9, 4, 4.4, are all acceptable lengths. Since you mentioned CC-ing it a 3 or 4" barrel makes that easier.
It is conceivable that a good-manufacturer with a shorter barrel could be more accurate than a cheaper longer barreled gun. If you can rent/borrow as many as you can to get a feel for what is right for you.
Edited to add: My Kahr MK40 is a 3" barrel. It is less accurate than my Sigs but acceptable for Self Defense distances.