Our '02 Forester is doing the same thing.... and it may be due to cold temps, at least that's when it started. I found that if I loosen the tilt lever and move the steering column up and down, the shift release lock button will depress and I can shift into park. This still doesn't mean it won't happen again when I stop at the drivethrough though. I suspect a sensor has gone bad in the steering column.
Subaru Forester was created in 1997.
Subaru Forester has a timing belt.
The 2005 Subaru Forester has 16 valves.
The 2009 Subaru Forester has 16 valves.
The 2008 Subaru Forester has 16 valves.
The 2001 Subaru Forester has 16 valves.
The 2003 Subaru Forester has 16 valves.
The 2006 Subaru Forester has 16 valves.
The 2004 Subaru Forester has 16 valves.
The 2011 Subaru Forester has 16 valves.
The 2002 Subaru Forester has 16 valves.
The 2014 Subaru Forester has 16 valves.