Some people do not optimize until needed. Anyway on this case the resource or performance penalty is probably minimal.
In other words, you probably don´t need to worry, you will have other things to optimize.
This will return or set the Main Window of the Application:
// http://msdn.microsoft.com/en-us/library/system.windows.application.mainwindow.aspx
var w = Application.Current.MainWindow;
Use this to return a reference to the Window the control is located:
// http://msdn.microsoft.com/library/vstudio/system.windows.window.getwindow.aspx
Window.GetWindow(theDependencyObject);
You said that you need to access the window which hosts a given control.
Then I think that the more appropriate semantically is:
Window.GetWindow(theDependencyObject);