In December 2015 I plan to go do Panama then go back into Costa Rica probably by foot, meaning taking a bus or boat on both sides of the border then crossing by foot. I heard there is a $40 exit tax when leaving Panama, does this only apply to flying? What is the exit tax when crossing by foot?
There is no tax to pay at the Costa Rica border. The "Exit Tax" you've heard of only applies to those who are flying out of the country, and is officially called the "Airport Tax".
Source: I traveled from Panama to Costa Rica in 2010.