The function PDF_fit_textline has an "optlist" argument which you use to pass options. In other words, PDF_fit_textline contains many functions instead of one. A classical code smell.
The fact that the optlist argument is a string uglyfies this function by a factor of thousand.
Conclusion: when you make functions like PDF_show_boxed deprecated, replace it with a better function instead of doing the opposite.