Look at flag --standalone. At least for html output pandoc seems to be able to handle something that feels like partial pandoc input in practice and produce html output that behaves like a snippet.
Pandoc AST - format called "native" - parses faster than pandoc markdown.
Trigonometric polynomials are also polynomials. And linear spaces are all "the same". That is what the definition is for. Even the transpose-mapping is linear.
Computers are very good at repeating a known "recipe". They can add numbers billions of time per second. Yes, billions with a bee.
The hard part is coming up with a recipe that solves your problem and that the machine can run without breaking things when it runs around with a few billion steps per second. You have to think ahead for it and handle edge cases in the recipe.
Probably busy doing data processing at any given moment.