Currently `subst-char-in-region' calls `modify_text' on the entire text, starting from the first match to the end of the text, which fires off `before-change-functions' for (almost) every character in the region it's called in. The specific place where this caused a problem for me is while filling paragraphs with latex fragments in org-mode. Latex fragments are overlays with the `modification-hooks' property set to delete the overlay, so when a paragraph is filled, that calls (subst-char-in-region ?\n ?\s ...) on the entire paragraph which then calls `modify_text' on the entire paragraph (sans the first line), which causes all latex fragments to disappear. I'm assuming that there isn't any particular reason why `modify_text' should be called on the whole paragraph, but if there is, then that's ok too, I suppose. I don't see any reason why this should be breaking stuff, but I haven't actually checked.