Looks like you have 2 concerns:
1) The filtered out data should not be selected.
Solution: dataModel.data doesn't include the filtered out rows, so there is no problem in using dataModel.data
2) How to select all rows on all pages with hundreds of thousand of rows from performance point of view.
Solution: selection method is designed for selection of few rows, hence not suitable in your case. You need to use pq_rowselect property of every rowData in order to select rows en masse.
var data = dataModel.data;
for(var i=0, len=data.length; i<len;i++){
var rowData=data[i];
rowData.pq_rowselect = true;
}
//refresh after the loop
$grid.pqGrid( 'refresh' );
Please let know whether it answers all your concerns or have I missed something..