The best way, performance wise, to export data to Excel is to create a data grid, allow users to filter and add a default Export to CSV button. You will be able to export large amounts of data this way, and the file can be opened in Excel.
The second best way performance wise is to create an OData service, set pagination to e.g. 500 and let users access the data in Excel through an OData feed. However, this solution has quite an impact on usability.
25.000 records may lead to performance issues, especially if multiple users start requesting such files. You may be able to solve this by ensuring only a single Excel file is being generated at the same time. You could achieve this by using the ProcessQueue module, or by setting the ‘Disallow concurrent execution’ flag on the microflow that generates the Excel file.