Gorse (Urex europaeus) is part of the pea/legume family. It's for that reason that Gorse was loved by the early British and originally brought over to New Zealand, as a nitrogen fixing crop to improve deforested soils, and as a hedging plant. Unfortunately it went rogue and is now so widespread it’s definitely class as an invasive pest.
In Britain Gorse was planted in agricultural areas to improve & enrich the soil. Every part of the plant was valued, to the point that laws were passed to ensure that it wasn't overharvested (can you believe it!). The plant was well managed to prevent spreading, the young shoots were used to feed livestock, the oil rich wood as firewood, the ashes to make soaps & as a rich source of potassium to be used as a fertiliser. The roots were used to stabilise loose soil & prevent erosion.
The good news is that despite popular belief, Gorse actually acts as a great nurse crop for NZ native plants & regenerating forest. They shelter and nurture the young natives, protecting them from wind & sun and trampling (from deer, goats & pigs), and then when the native gets tall enough to shade out the gorse, it dies back & feeds and enriches the soil. (BTW I am not encouraging the spread of Gorse in NZ! No way, however if you have access why not forage some flowers).
Gorse was also used to create soap. It was first burned and the ashes rich in alkali were used in washing, often mixed with clay and made into lumps to form soap.
The ashes have also been used extensively to fertilise soils.
The young shoots of the plant have often been fed to horses, cows and sheep.
Gorse flowers have an interesting slight coconut / vanilla flavor which you wouldn't expect. The flowers can be used in wild brewing and wild drinks (many people speak fondly of Gorse Wine), or thrown into salads for their color.
Be warned that it takes a very very long time to pick a substantial amount of gorse flowers, especially given the prickly nature of the plant.
Note that Gorse contains slightly toxic alkaloids, and should be consumed in moderation.