This is a possible proposal to implement:
stringtheory.like(haystack text, search text) -> boolean
The implementation would only optimize only if search text is either: %foo% (substring), %foo (suffix), or foo% (prefix) search. Otherwise the implementation would fall back to the Postgres built-in LIKE search automatically.
Possible gotchas:
%_foo% would not be supported, since _ means "matches any 1 character"
%\_foo% is supported, since the backslash escapes the _.