Modification is my first choice exit as well. Many notes are so far underwater with respect to value, you end up purchasing at a very low % of UPB and can therefore afford to reduce principal as part of the mod, helping the homeowner, and end up with a performing note at an excellent yield. You can then sell that note at a more modest yield after some seasoning or just hold it in your portfolio.
Deed in lieu and short sale are second choices, and quicker than foreclosure. They can be feasible in cases where there are no junior liens in place and you can make contact with the borrower.
Foreclosure is the exit of last resort for me, due to the expense and long timeframe in many states. However, it can be the only option if other exits are not feasible. Because foreclosure has the greatest cost associated with it, it makes sense to use it as the primary yardstick for evaluating an investment, i.e., if the investment does not work under a foreclosure exit scenario, its not viable because you cannot rely on the feasibility of other exits.