Letting a view know in which pane it's being displayed
Build your views as "view content pane" displays.  That way any context you require for use in contextual filters can be provided in the panel UI when you set up the pane.