Allow printing from const functions

closes #3338