The action triggered by clicking on `clear` doesn't seem to be associated with a specific function. So you'll have to create a function that replicates this action:

```el
(defun my-notmuch-clear-search-history ()
 (interactive)
 (when (y-or-n-p "Are you sure you want to clear the searches? ")
 (setq notmuch-search-history nil)
 (notmuch-hello-update)))
```