Ok, just found out that you can use notnull constraint:
public static TValue Get<TKey, TValue>(
this Dictionary<TKey, TValue> src,
TKey key, TValue @default)
where TKey : notnull
=> src.TryGetValue(key, out var value) ? value : @default;