if you just want to draw a triangle, there's higher level libraries for that purpose. this is a low level library built to abstract (but map as close as possible to) modern backends (Vulkan, DX12, etc). the idea with these backends is to give precise control over the pipeline - that kind of precise control does not lend itself to the higher level abstractions you are looking for.
that said, it's not like this scales linearly so that 1,000 triangles is 385,000 lines of code. there's a lot of plumbing to setup the pipeline for your application's specific use case.
again, if your use case does not require the flexibility, look elsewhere.
Good to know I was under the impression that to draw 2 triangles I need to copy paste the whole code twice. I have been a graphics programmer for over 25 years. I'm not even commenting on the API. The toy example certainly can be reduced in code length even given the current API.
that said, it's not like this scales linearly so that 1,000 triangles is 385,000 lines of code. there's a lot of plumbing to setup the pipeline for your application's specific use case.
again, if your use case does not require the flexibility, look elsewhere.