char* bufみたいなやつをboost::python::str(buf)すると
TypeError: No to_python (by-value) converter found for C++ type: char
って怒られる。strのコンストラクタ見たらstr(char const* s)って書いてある。だから
boost::python::str(const_cast<const char*>(buf))
が正解。なんでコンパイル時にエラーにならないのかと思ったらこんなのがあった。
template <class T>
explicit str(T const& other);