The super nice thing about Obsidian is that your files and structure are not obsfucated or stored in proprietary file extensions. With everything in md files in a folder structure, you can do all manner of search/read/write functionality with external programs.
Got a long markdown file with tons of heading? Open that file in vscode with markdown plugins and it can create a ToC for that file automatically.
If you have a specific pattern (say a heading #1 at the top of each page/file) across files, you could have a python script read all files in a folder and search for that pattern, combine/manipulate them in memory and output an aggregate. Python is super fast when dealing with multiple files. This would give you an aggregate file that contains all of the H1 elements at the top of your page.
You could also limit this by also pages/files that have a specific tag then repeat for each tag you want. Only limit is your creativity.