If you must collect the data into a buffer, then
buffer .= @view data[inds]
is the way to go. There’s normally no cost to creating the view, this should just directly retrieve the data points into the buffer.
But if you subsequently iterate just a single time over the buffer, like for example with sum(buffer), then this is just a waste of time, and directly summing the view sum(@view data[inds]) is as good as it gets. Then you just traverse the data a single time, summing as you go. No need to traverse the data twice if once will do.
If the indices are non-contiguous and you will access them multiple times, collecting them in a buffer might be worth it.
Based on your example, a view seems to be exactly what you want.