Using ob_get_content to get_search_form puts into infinite loop

There is no safe way to catch the content of a searchform.php in this case. You could run output buffering on the complete page, but then you would probably run into conflicts with other plugins doing the same.

Alternative solution: Add a widget to your plugin that offers another search form. Ask your users to use that instead of the built-in widget or theme search form.

Some themes use a hard coded call to get_search_form() – there is nothing you can do.