1) You can create an alias that is attached to a F(unction) key, either with or without the Shift and/or Ctrl keys.
eg:
alias F3 { clear $active }
With this code, pressing the F3 key will clear the buffer of the active window.
2) Here are two codes for your second request. The first one works as a stand alone script, the second incorporates the code I provided for your first request.
on me:*:join:#: clear $chan