After some research I found the answer. You can supply static functions to .def as well. Just give it to_iso_extended_string
and it gets the object as first argument.
BOOST_PYTHON_MODULE(mymodule)
{
class_<boost::gregorian::date>("Date")
.add_property("year", &boost::gregorian::date::year)
.add_property("month", &boost::gregorian::date::month)
.def("__str__", &to_iso_extended_string)
;
}