You mention that you don't want a full viewshed (i.e. a raster output), which suggests that a simple point-to-point intervisibility is more what you're after.
There is a QGIS plugin called Viewshed analysis. As well as the usual raster options, this also has an intervisibility vector option.
If you have a layer with a number of points, scattered over the DEM, you can get it to draw lines between any pairs of points which are mutually intervisible, like so:-
(in this case I added 200 points at random on a DEM, and chose to show only pairs which are mutually visible)
The options look like this. Make sure to choose a radius in Map Units, and make sure to complete both layer names - if you don't, you'll end up with one raster per point :-)
As it's a plugin, rather than a processing algorithm, it's not amenable to scripting unfortunately.. but it's open source, so you might be able to look at the source to see how this is implemented.
The code repo also has a .bib file with links to papers which might be of interest