Accurate way to programmatically generate a main sequence star? I am working on a (personal) programming project, part of which involves generating random stars and their parameters.

In order to create a procedurally generated star, I want to randomly select as few parameter values as possible, and then extrapolate the rest using formulas.

For instance by interpreting the Stefan-Boltzmann law I can derive the star's luminosity based on the surface temperature and the star's radius:

$$
L = 4 \pi R^2 \sigma T_{e}^4
$$

There are however other parameters that I would like to generate, such as the mass of the star. What seems to be able to help me is the mass-luminosity relation:

$$
\frac{L}{L_{\odot}} = \left(\frac{M}{M_{\odot}}\right)^a
$$

By knowing $a$ (based on my randomly selected mass) it seems that I can derive the star's luminosity. By glancing at the Hertzsprung–Russell diagram (e.g. this one) I can see that I can perhaps somehow calculate the radius of the star, but I'm not entirely sure how.

There is an existing star "generator" which can be found here, however this one interpolates existing data using logarithms.

My full question would be, is there a way to "generate" a "regular", main sequence star, starting from one or two parameters and extrapolating the rest using formulas? Is there a sensible relation between the mass of the star and its radius that can be used to generate a "realistic" star? Or would most parameters need to be interpolated from existing data?
This is a tricky question, not immediate. 

If we talk about Main Sequence stars, yes, you can constrain your fictional star by two parameters. The crucial parameters in the diagram, as you said, are the mass and the radius. This is why the HR diagram well represents the stellar population with two axis. Of course, for your scope, we need to do some assumptions. For example, the metallicity, that for your purposes can be fixed as the Solar one. Or, that the initial mass is already in a condition to contract.

You can see it this way: the luminosity is connected with the radius (because it depends on the irradiating surface), while the temperature is connected with the mass (the more is the mass, the more is the pressure at the center of the star).

If you have $L \sim RT$ and $L \sim M$, then you also have $RT \sim M$. 
The degeneracy from one parameter can be overcame if you have your reference star (the Sun), which allows you to trace isoradii lines on the HR diagram. See here for example:

Or, that is equivalent, you can express your first equation (Stefan-Boltzmann), in Solar units as well (as shown here).

Try it out just by your self: choose a mass, or observationally speaking, choose a luminosity. Then trace your line on the HR diagram, and find your star. That star has a defined temperature (spectral class), Mass and Radius as well.

If you need the exact equations, feel free to ask please.

Nice aim, anyway. Have fun!