Recently had a mechanic install a new head unit and replace the climate control in my 07 Forester X, got the car back with the check engine light flashing rapidly and these 14 error codes:
p1518
p0851
p1152
p1153
p0502
p0503
p0140
Foresters of your vintage are prone to error codes. So, the first step is to clear the codes (with an OBDII Reader/eraser). Then, see if the codes come back.
The codes you list are all over the landscape, relating to different systems that are not much related to each other. So, it's unlikely that your O2 sensor is failing (for one example) - the problem is probably in the wring to that sensor.
It's possible the mechanic wired up something incorrectly. Behind your center console are a variety of wiring connectors. Some are similar in appearance. Some are simply not used (many cars tend to have an abundance of unused plugs). So, check all the connections. In the electrical service section of the vehicle manual are illustrations of the various connectors which might help in sorting things out.
Look under the hood at the "bulkhead connector". I don't know why the mechanic would have messed with this, but if it's disturbed and not placed back together correctly, it will throw error codes like there's no tomorrow.
Finally, there may be a large multi-function connector behind the console that was disturbed. There are several major wiring bundles behind the console so check each one. Make sure connectors are tight, and/or take them apart, put back together, repeat, be sure they are well seated.
You mentioned climate control, which is a fairly straight-forward electrical connection between the wiring harness and the climate control module. At least on vehicles with push-wire controls for temperature and vent position, it's possible to run the push-wires incorrectly so as to strain the wiring harness(es). It might be possible to improperly route one of the large wring bundles behind the console, so as to cause strain on the harness (and maybe pull a connection apart). The devil is in the details.