This would have to be tested in court. This document from the Dept. of Justice and the National Institute of Justice, Federal Prosecution of Election Offenses 5th ed dated May 1988, points out that the law was (accidentally?) modified by act of Congress with this bit:
SEC. 201. (a)(1) Chapter 29 of title 18, United States Code,
is amended by striking out section 591. (2) The table of
sections for chapter 29 of title 18, United States Code, is
amended by striking out the item relating to section 591.
18 USC 591 was a set of definitions restricting the prohibited acts – as it stands, there are no limitations on 18 USC 597. The DOJ note observes that
A literal reading of Section 597 is theoretically capable of reaching
anything that can be characterized as an "expenditure" which is made
for the purpose of affecting the voting process at any proceeding that
can be characterized as an "election...."
The repeal of this definitional section has thus for the first time
left 18 U.S.C. 597 technically unencumbered by restrictive concepts
that formerly confined its scope to the federal context.
It is the position of the Criminal Division that the repeal of this
definitional section was not intended by Congress to create in 18
U.S.C. 597 a vote-buying statute of virtually unlimited scope.
Rather, it seems that the reason Congress repealed 18 U.S.C. 591 was
out of a belief that the definitions contained therein were redundant
to the definitional section governing the Federal Election Campaign
Act, 2 U.S.C. 431.
(subsequently reclassified 52 USC 30101). The term "expenditure" is defined there as exclude "(ii) nonpartisan activity designed to encourage individuals to vote or to register to vote".
Since "expenditure" is not defined, we might (misguidedly) conclude that it only means "payment of money". But "free beer if you vote for Wally" is exactly the kind of vote-buying that the law was designed to criminalize. Giving something of value is an expenditure: a ride to the polls is something of value.
The rest of the sentence outlaws expenditures
either to vote or withhold his vote, or to vote for or against any
This means, then, that an expenditure made to a person to vote is against the law (and, it does not matter whether this is a federal or a state election, since that part was wiped out). The current (8th) edition of Federal Prosecution of Election Offenses does not have the same disclaimer language about how DoJ intends to interpret the law.
Were the matter to end up in court, there would be a predictable tussle over the latter of the law versus legislative intent. In this case, I suspect that the legislative intent side would prevail, since the existing law is of questionable constitutionality, owing to its unrestricted nature.