The distribution of values of $L(1,\chi_d)$ as $d$ varies over fundamental discriminants has been extensively studied. For example, see this paper of Granville and Soundararajan which gives uniform such results (and discusses other references and history). The main result there shows that $L(1,\chi_d)$ is distributed like a random Euler product $L(1,X)= \prod_p (1-X(p)/p)^{-1}$ where $X(p)$ for primes $p$ denote independent random variables with $X(p)=1$ with probability $p/(2(p+1))$, $-1$ with probability $p/(2(p+1))$ and $0$ with probability $1/(p+1)$. From this the last assertion you make about fundamental discriminants follows: you want to compute (for large $D$) $$ \exp\Big( \frac{1}{|\{|d|\le D\}|} \sum_{|d|\le D} \log L(1,\chi_d) \Big) \sim \exp\Big({\Bbb E} (\log L(1,X)) \Big) = \prod_p \Big(\frac{p^2}{p^2-1}\Big)^{\frac{p}{2p+2}}. $$ Small modifications to the same techniques would allow you to study the family of prime discriminants that you mentioned -- the only difference is in adjusting the probabilistic model to reflect the fact that very few prime discriminants will be divisible a given prime $p$ (as opposed to all fundamental discriminants where this proportion is $1/(p+1)$).
Lucia
- 43.7k
- 6
- 193
- 219