The most annoying noise

My 2002 Subaru Forester is making this weird clicking noise and unlocking as I drive. It seems to get worse at night, and especially when turning left, or braking. My mechanic can’t figure it out. Help?

This really needs a bit of clarification.
Are you trying to tell us that the door locks are unlocking by themselves as you drive?
If that is the case, the clicking is likely to be from the electrical relay in the circuitry for the door locks.

But–where exactly is the clicking sound emanating from?
Are you referring to the door locks?

Clicking noise turning left would suggest a bad CV axle. However, I can’t imagine any mechanic on earth wouldn’t be able to figure that one out.

Clarify “unlocking as I drive”.

Yes, the doors are unlocking themselves as I drive. It seems to be coming from the driver’s side the most, but all the doors are affected. It has gotten to the point where the car will not lock, even if I manually lock all the doors without the car running.
The clicking sound is a very similar noise to my turn signal. I think it is coming from the dash/driver’s side, but it is hard to pinpoint. Nothing physical happens with the clicking, just the noise.

I’m going to suggest that the clicking noise is a wire in the harness between the chassis and the door shorting out to the chassis (ground) as the body flexes when turning…and unlocking the doors. If it were me, I’d pull the door panel, split the harness (it’ll be tied and possible wrapped), and start troubleshooting with a multimeter with pin probes. In your case you may want to try a shop that specializes in automotive wiring.

+1 to mountainbike’s suggestion, but before you open up the door panel, I would suggest that you check the thick wiring bundle located in the area of the door hinges, encased in heavy black rubber boot. Since this bundle of wires flexes every time that you open the door, wires inside that boot can become damaged, as can the boot itself.

I think a wire shorting out would likely make more of an intermittent sizzling sound, not a regular clicking sound. If your car has a feature that locks the doors while you’re moving, and unlocks them when you put it in park check the owner’s manual and see if there’s a way to disable that. I think the switch that detects when you’re in park may be malfunctioning, or the body controller module may have a problem.

“If your car has a feature that locks the doors while you’re moving, and unlocks them when you put it in park check the owner’s manual and see if there’s a way to disable that.”

The OP’s car does not have that feature.
Trust me–I know.

Okay, if the car doesn’t have this feature, I would think the first troubleshooting step would be to open the doors and wiggle/pull on all the wiring to see if you can make the problem occur.

So my mechanic pulled out the door panels and checked the wiring but could not find anything… the main issue remains that the doors won’t lock anymore - not only does the automatic lock button not function any longer, though intermittently it does, but manually locking the doors by flipping the lock button on the doors from the inside, or using the key from the outside, does not lock. If I sit in the car with it off and keys not in ignition, and someone leans on the car, it will trigger the unlock mechanism, regardless of whether car was previously locked or unlocked. When I drive, the car unlock mechanism will randomly activate.
The second, and possibly unrelated issue, is a clicking noise that sounds like a blinker coming from the driver side dash area. The two phenomenons appear related in that the clicking only happens when the unlocking is occurring, but the unlocking can occur without the clicking.

Just paid my mechanic $96 for him to remove the door panels and try to figure it out unsuccessfully: what next???

Maybe the problem is caused by body flex; something that occurs with every car. Panels shift and move while in operation so maybe a door is not fully depressing a door switch.
For test purposes one could apply a couple of layers of duct tape over the switch buttons on the door jams to see if the problem disappears. If it does go away then either the switch is iffy or adjusment of the door may be needed.
Has the car been in any accidents?

Just in case this is a matter of 2 separate problems, I would agree that a clicking noise, especially when turning, usually points to a CV joint problem.